body {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* height: 100vh; */
    background-color: #f0f0f0;
    /* margin: 0;
    background-image: url('background.jpg');
    background-size: cover;
    background-position: center; */
}

h1 {
    margin-bottom: 20px;
}

.button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

button {
    width: 200px; /* Set a consistent width for all buttons */
    padding: 15px 30px;
    font-size: 18px; /* Set a readable font size */
    margin: 10px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s, box-shadow 0.3s;
}

button:hover {
    background-color: #007bff;
    color: white;
}

button:active {
    background-color: #0056b3;
}

button:enabled {
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

button:disabled {
    background-color: #ccc; /* Set a grey background */
    color: #666; /* Set a lighter text color */
    cursor: not-allowed; /* Show a "not-allowed" cursor */
    border: 1px solid #aaa; /* Optional: Adjust border color */
}

.container {
    max-width: 500px;
    margin: 10px auto;
    padding: 10px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-align: center;
}

.camera-area {
    width: 100%; /* Set the width to 90% of the parent container */
    aspect-ratio: 3 / 4; /* Enforce a vertical aspect ratio */
    background: #f0f0f0;
    display: block;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #888;
    overflow: hidden; /* Prevent overflow */
    position: relative; /* enable absolute overlay positioning */
}

/* Overlay distance controls */
.overlay-controls {
    position: absolute;
    bottom: 4px;
    left: 4px;
    top: auto;
    right: auto;
    display: flex;
    flex-direction: column-reverse; /* 0.5m at bottom, 1.0m above */
    align-items: flex-start;
    gap: 4px; /* small spacing between buttons */
    z-index: 2;
    pointer-events: none; /* allow inner buttons only */
}

.overlay-btn {
    pointer-events: auto;
    width: 48px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.6);
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 12px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(2px);
    cursor: pointer;
    user-select: none;
    box-sizing: border-box; /* ensure width/height include border/padding */
    padding: 6px 6px;             /* small vertical + wider horizontal padding */
    margin: 6px;
    white-space: nowrap;          /* keep text on one line */
}

.overlay-btn.active {
    background: rgba(255,255,255,0.85);
    color: #000;
    border-color: rgba(0,0,0,0.4);
}

/* Reset any overlap on the upper (1.0m) button */
.overlay-controls .overlay-btn[data-quality="5mp30"] {
    margin-bottom: 0; /* was -2px */
}

.video-area {
    width: 100%; /* Make the video fill the width of the container */
    aspect-ratio: 3 / 4; /* Enforce a vertical aspect ratio */
    object-fit: contain; /* Ensure the video fits within the container without cropping */
    display: block;
}

.invisible-canva {
    width: 100%; /* Make the video fill the width of the container */
    aspect-ratio: 3 / 4; /* Enforce a vertical aspect ratio */
    object-fit: contain; /* Ensure the video fits within the container without cropping */
    display: none;
}

#screenshot-btn {
    font-size: 1.1rem;
    border: none;
    border-radius: 5px;
    background: #bbb;
    width: 100%;
    margin: 10px 0;
}

#service-widget {
    width: 100%;
    margin: 10px 0;
    display: none;
}

#egg-new-message {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
    box-sizing: border-box;
    resize: vertical;
    min-height: 60px;
    max-height: 200px;
    overflow-y: auto;
}

.overlay-result {
    position: absolute;
    bottom: 4px;
    right: 4px;
    z-index: 2;
    pointer-events: auto;           /* allow clicking links */
    background: rgba(0, 0, 0, 0.55);/* dark semi-transparent */
    color: #fff;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 24px; /* was 12px */
    line-height: 1.2;
    max-width: 70%;
    white-space: normal;
    word-break: break-word;
    display: none;                  /* shown when result arrives */
}

.overlay-result a {
    color: #93eef3;
    text-decoration: underline;
    word-break: break-all;
}

.overlay-result.error {
    background: rgba(120, 20, 20, 0.55); /* slight reddish flavour */
    /* optional subtle red glow */
    box-shadow: 0 0 0 1px rgba(255, 100, 100, 0.35) inset;
}

.read-more {
  margin: 2px 0 0;
  font-size: 14px;
  text-align: center;
  color: #000000;
}
.read-more a {
  color: #0d6efd;           /* link-like blue */
  text-decoration: underline;
}

.cta-bottom {
  margin: 2px 0 0;
  font-size: 14px;
  text-align: center;
  color: #000000;
}
.cta-bottom a {
  color: #0d6efd;           /* link-like blue */
  text-decoration: underline;
}

.info-panel {
  background: rgb(255, 255, 255);
  border: none;
  border-radius: 0px;
  padding: 4px 4px;
  /*display: inline-flex;*/
  flex-direction: column;
  align-items: center;
  gap: 2px;
  /*box-shadow: 0 2px 8px rgba(0,0,0,0.12);*/
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.scanner-title {
  font-weight: 600;
  font-size: clamp(1.3rem, 12vw, 1.5rem); /* responsive but not too small */
  color: #000000;
  background: rgb(255, 255, 255);
  display: inline-block;
  padding: 6px 16px;
  border: none;
  border-radius: 0px;
  margin-bottom: 10px;
  margin-top: 0;
  text-align: center;
  white-space: nowrap;           /* always one line */
  overflow: hidden;
  text-overflow: ellipsis;       /* show ... if it ever overflows */
}

.viewer-overlay {
  position: absolute;
  top: 12px;
  left: 12px; /* <-- changed from right: 12px; to left: 12px; */
  z-index: 25;
  color: #fff;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  padding: 8px 12px;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
}

.overlay-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
  font-size: 16px;
  line-height: 1.25;
  text-align: left; /* align list entries to the left */
}

.overlay-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: center;
  white-space: nowrap;
}

.overlay-list li::before {
  content: "✅";
  font-size: 18px;
}

.overlay-list .overlay-caption {
  display: block;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 6px;
}

.overlay-list .overlay-caption::before {
  content: none;
}

.camera-area {
  position: relative; /* ensure overlay is positioned absolutely inside */
}

/* Optional: small screens */
@media (max-width: 480px) {
  .viewer-overlay {
    padding: 6px 10px;
  }
  .overlay-list {
    font-size: 14px;
  }
  .overlay-list .overlay-caption {
    font-size: 18px;
  }
}

/* Password overlay styles */
.password-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.password-dialog {
    background: white;
    padding: 20px;
    border-radius: 8px;
    max-width: 300px;
    width: 90%;
    text-align: center;
}

.password-dialog h3 {
    margin-top: 0;
    color: #333;
}

.password-dialog input {
    width: 100%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

.password-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
}

.password-buttons button {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

#password-confirm {
    background: #007cba;
    color: white;
}

#password-cancel {
    background: #ccc;
    color: #333;
}