:root {
  --page-bg: #000000;
  --panel-top: #3a3a3a;
  --panel-mid: #363636;
  --panel-bottom: #191919;
  --text: #f2f2f2;
  --muted: rgba(242, 242, 242, 0.78);
  --edge: #151515;
  --button: #2d2d2d;
  --button-edge: #454545;
  --accent: #00ff88;
  --background-photo: none;
  --background-photo-zoom: 1;
  --background-photo-x: 50%;
  --background-photo-y: 50%;
  --background-photo-opacity: 0.42;
  --colour-overlay-opacity: 1;
  --frame-gap: 10px;
  --button-shadow: 0 3px 9px rgba(0, 0, 0, 0.7);
  --timer-shadow: 0 0 18px rgba(0, 0, 0, 0.9);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  overflow: hidden;
  background: var(--page-bg);
  color: var(--text);
  font-family: Arial, sans-serif;
  padding:
    calc(var(--frame-gap) + env(safe-area-inset-top))
    var(--frame-gap)
    calc(var(--frame-gap) + env(safe-area-inset-bottom));
}

button,
input {
  font: inherit;
}

button {
  border: 1px solid var(--button-edge);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.10)),
    var(--button);
  color: #ffffff;
  min-width: 98px;
  min-height: 40px;
  padding: 10px 26px;
  cursor: pointer;
  box-shadow: var(--button-shadow);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:active:not(:disabled) {
  transform: translateY(1px);
}

.timer-shell {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 20px clamp(16px, 4vw, 30px) 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  border-radius: 26px;
  border: 2px solid var(--edge);
  background:
    radial-gradient(
      circle at top,
      var(--panel-top) 0%,
      var(--panel-mid) 55%,
      var(--panel-bottom) 100%
    );
  box-shadow: 0 0 35px rgba(0, 0, 0, 0.8);
}

.timer-shell > * {
  position: relative;
  z-index: 1;
}

.background-photo-layer,
.colour-overlay-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.background-photo-layer {
  background-image: var(--background-photo);
  background-position: var(--background-photo-x) var(--background-photo-y);
  background-repeat: no-repeat;
  background-size: cover;
  opacity: var(--background-photo-opacity);
  transform: scale(var(--background-photo-zoom));
  /* Zoom toward the chosen focal point so vertical/horizontal positioning keeps
     working when zoomed in (matches the Android pan behaviour). */
  transform-origin: var(--background-photo-x) var(--background-photo-y);
}

.colour-overlay-layer {
  opacity: var(--colour-overlay-opacity);
  background:
    radial-gradient(
      circle at top,
      var(--panel-top) 0%,
      var(--panel-mid) 55%,
      var(--panel-bottom) 100%
    );
}

.logo-pane {
  padding-top: 2px;
}

.logo {
  display: block;
  width: 100%;
  height: auto;
  max-height: clamp(180px, 34vh, 360px);
  object-fit: contain;
  margin: 0 auto;
}

.timer-pane {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.timer-display {
  font-size: clamp(86px, 14vh, 230px);
  line-height: 1;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-align: center;
  text-shadow: var(--timer-shadow);
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 16px 38px 0;
  color: var(--muted);
  font-size: 14px;
}

.control-row,
.settings-row-main {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
}

.settings-row-main {
  margin-top: 10px;
}

.status-text {
  min-height: 21px;
  margin-top: 8px;
  text-align: center;
  color: rgba(242, 242, 242, 0.62);
  font-size: 13px;
}

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding:
    calc(24px + env(safe-area-inset-top))
    28px
    calc(24px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.modal.open {
  display: flex;
}

.modal-content {
  width: min(420px, 100%);
  max-height: min(760px, 100%);
  overflow-y: auto;
  border-radius: 20px;
  background: var(--tint-dialog-bg, #202020);
  padding: 24px;
  border: 1px solid var(--tint-card-border, rgba(255, 255, 255, 0.08));
  box-shadow: 0 24px 65px rgba(0, 0, 0, 0.86);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 22px;
}

.about-content {
  max-width: min(560px, 100%);
}

.about-body {
  display: grid;
  gap: 14px;
  color: rgba(255, 255, 255, 0.76);
}

.about-body section {
  padding: 14px;
  border: 1px solid var(--tint-card-border, rgba(255, 255, 255, 0.07));
  border-radius: 14px;
  background: var(--tint-card-bg, #171717);
}

.about-body h3 {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 15px;
}

.about-body p {
  margin: 0 0 8px;
  line-height: 1.48;
}

.about-body p:last-child {
  margin-bottom: 0;
}

.icon-button {
  min-width: 40px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 28px;
  box-shadow: none;
}

.settings-card {
  margin: 12px 0;
  padding: 14px;
  background: var(--tint-card-bg, #171717);
  border: 1px solid var(--tint-card-border, rgba(255, 255, 255, 0.07));
  border-radius: 14px;
}

.quick-save-row {
  display: flex;
  justify-content: center;
  margin: 4px 0 16px;
}

.settings-label {
  margin-bottom: 10px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.input-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.input-grid label,
.single-input {
  display: grid;
  gap: 6px;
  color: rgba(255, 255, 255, 0.54);
  font-size: 12px;
}

.input-grid input[type="number"],
.single-input input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--tint-card-border, #333333);
  border-radius: 10px;
  font-size: 16px;
}

.input-grid input[type="number"]:focus,
.single-input input[type="number"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 255, 136, 0.15);
}

.colour-heading,
.colour-row,
.colour-tools {
  display: flex;
  align-items: center;
}

.colour-heading {
  justify-content: space-between;
  gap: 12px;
}

.colour-heading .settings-label {
  margin-bottom: 0;
}

.small-button {
  min-width: 74px;
  min-height: 32px;
  padding: 6px 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
}

.wide-button {
  width: 100%;
  margin-top: 12px;
}

.layout-segment {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--tint-card-border, rgba(255, 255, 255, 0.07));
}

.segment-button {
  min-width: 0;
  min-height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.62);
  background: transparent;
  box-shadow: none;
  font-size: 13px;
}

.segment-button.active {
  color: #ffffff;
  background: var(--tint-button-bg, #2d2d2d);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}

.colour-row {
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.colour-tools {
  gap: 10px;
}

input[type="color"] {
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}

input[type="color"]::-webkit-color-swatch {
  border: 0;
  border-radius: 8px;
}

.hex-value {
  width: 72px;
  color: rgba(255, 255, 255, 0.38);
  font-size: 12px;
  text-align: right;
}

.file-input {
  width: 100%;
  margin: 4px 0 12px;
  color: rgba(255, 255, 255, 0.72);
}

.background-photo-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(0, 0, 0, 0.28);
  overflow: hidden;
}

/* The photo lives on a pseudo element so it can be zoomed/panned (matching the
   live timer) without the preview box itself overflowing its card. */
.background-photo-preview::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    var(--background-photo) var(--background-photo-x) var(--background-photo-y) / cover no-repeat;
  transform: scale(var(--background-photo-zoom));
  transform-origin: var(--background-photo-x) var(--background-photo-y);
}

.background-photo-preview.empty::before {
  display: none;
}

.range-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 36px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.range-row input {
  width: 100%;
}

.toggle-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 36px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.toggle-switch {
  position: relative;
  width: 44px;
  height: 24px;
  display: inline-block;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider-track {
  position: absolute;
  inset: 0;
  background: #333;
  border-radius: 999px;
  transition: background 0.15s ease;
}

.toggle-switch .slider-track::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #f5f5f5;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

.toggle-switch input:checked + .slider-track {
  background: var(--accent);
}

.toggle-switch input:checked + .slider-track::before {
  transform: translateX(20px);
}

.settings-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.primary {
  border-color: var(--tint-button-border, rgba(0, 255, 136, 0.45));
}

.android-download-link {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  left: 16px;
  z-index: 2;
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.10)),
    var(--button);
  border: 1px solid var(--button-edge);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  box-shadow: 0 3px 9px rgba(0, 0, 0, 0.7);
}

.android-download-link:hover {
  color: #ffffff;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.13), rgba(0, 0, 0, 0.08)),
    var(--button);
}

.notification-bell {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 2;
  min-width: 44px;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0.10)),
    var(--button);
  border: 1px solid var(--button-edge);
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-bell[hidden] {
  display: none;
}

.notification-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ff3b30;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
  /* White ring so it reads as a notification count, like system badges. */
  border: 2px solid #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.notification-badge[hidden] {
  display: none;
}

.notifications-content,
.notification-detail-content {
  background: var(--tint-dialog-bg, #202020);
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.notification-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 8px 12px 14px;
  background: var(--tint-card-bg, #171717);
  border: 1px solid var(--tint-card-border, rgba(255, 255, 255, 0.08));
  border-radius: 14px;
  cursor: pointer;
  text-align: left;
  color: #ffffff;
  width: 100%;
  font: inherit;
  box-shadow: none;
}

.notification-row .unread-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
}

.notification-row.read .unread-dot {
  visibility: hidden;
}

.notification-row .row-text {
  min-width: 0;
}

.notification-row .row-title {
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.notification-row.read .row-title {
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
}

.notification-row .row-preview {
  margin-top: 3px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.notification-row .row-trash {
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  min-width: 36px;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  box-shadow: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.notification-row .row-trash:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.notifications-empty {
  padding: 24px 4px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 14px;
  text-align: center;
}

.notification-detail-body {
  padding: 6px 2px 8px;
}

.notification-detail-body h3 {
  margin: 8px 0 16px;
  font-size: 22px;
  color: #ffffff;
  font-weight: 700;
}

.notification-detail-body p {
  margin: 0 0 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.45;
  white-space: pre-wrap;
}

.notification-detail-body img {
  display: block;
  width: 100%;
  height: auto;
  margin: 6px 0 16px;
  border-radius: 12px;
}

.notification-detail-link {
  display: inline-block;
  margin-top: 6px;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--tint-button-bg, #2d2d2d);
  border: 1px solid var(--tint-button-border, rgba(255, 255, 255, 0.18));
  color: #ffffff;
  text-decoration: none;
  font-size: 14px;
}

.logo-pane {
  display: block;
}

body.layout-landscape .timer-shell {
  max-width: 100%;
  display: grid;
  grid-template-columns: 1fr 1.35fr;
  grid-template-rows: 1fr auto auto auto;
  grid-template-areas:
    "logo timer"
    "logo controls"
    "logo settings"
    "logo status";
  align-items: center;
  gap: 12px;
}

body.layout-landscape .logo-pane {
  grid-area: logo;
  display: flex;
  align-items: center;
  justify-content: center;
}

body.layout-landscape .timer-pane {
  grid-area: timer;
}

body.layout-landscape .control-row {
  grid-area: controls;
}

body.layout-landscape .settings-row-main {
  grid-area: settings;
  margin-top: 0;
}

body.layout-landscape .status-text {
  grid-area: status;
  margin-top: 0;
}

body.layout-landscape .logo {
  max-width: 40vh;
  max-height: 70vh;
}

body.layout-landscape .timer-display {
  font-size: clamp(80px, 22vh, 240px);
}

body.layout-portrait .timer-shell {
  max-width: 520px;
  display: flex;
  flex-direction: column;
}

body.layout-portrait .logo {
  width: 100%;
  max-width: none;
  max-height: clamp(180px, 34vh, 360px);
}

body.layout-portrait .timer-display {
  font-size: clamp(86px, 14vh, 230px);
}

@media (orientation: landscape) and (max-width: 1024px) {
  body.layout-auto .timer-shell {
    max-width: 100%;
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    grid-template-rows: 1fr auto auto auto;
    grid-template-areas:
      "logo timer"
      "logo controls"
      "logo settings"
      "logo status";
    align-items: center;
    gap: 12px;
  }

  body.layout-auto .logo-pane {
    grid-area: logo;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  body.layout-auto .timer-pane {
    grid-area: timer;
  }

  body.layout-auto .control-row {
    grid-area: controls;
  }

  body.layout-auto .settings-row-main {
    grid-area: settings;
    margin-top: 0;
  }

  body.layout-auto .status-text {
    grid-area: status;
    margin-top: 0;
  }

  body.layout-auto .logo {
    max-width: 40vh;
    max-height: 70vh;
  }

  body.layout-auto .timer-display {
    font-size: clamp(96px, 22vh, 240px);
  }
}

@media (min-width: 768px) {
  .timer-shell {
    max-width: 900px;
  }

  .timer-display {
    font-size: clamp(110px, 18vh, 260px);
  }
}

@media (max-width: 380px) {
  .meta-row {
    margin-left: 18px;
    margin-right: 18px;
  }

  button {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* ------------------------------------------------------------------ */
/* Etiquette / Hygiene & Mat Care screen                               */
/* ------------------------------------------------------------------ */

.etiquette-screen {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
}

.etiquette-screen.open {
  display: block;
}

.etiquette-bg {
  position: absolute;
  inset: 0;
  background: url('assets/mat_texture.jpeg') center / cover no-repeat;
}

.etiquette-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.etiquette-inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding:
    calc(10px + env(safe-area-inset-top))
    16px
    calc(10px + env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.etiquette-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.etiquette-logo {
  height: clamp(44px, 8vh, 72px);
  width: auto;
}

.etiquette-heading {
  flex: 1;
  min-width: 0;
}

.etiquette-heading h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(20px, 3.4vw, 34px);
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1.05;
}

.etiquette-heading h1 span {
  color: #ff6a00;
}

.etiquette-tagline {
  margin: 2px 0 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: clamp(10px, 1.3vw, 13px);
}

@media (max-width: 479px) {
  .etiquette-tagline {
    display: none;
  }
}

.etiquette-slides {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* Visible so the badge glow bleeds past the slide area and fades out
     naturally instead of cutting off flat at the header and nav. */
  overflow: visible;
  padding: 8px 0;
  min-height: 0;
}

/* One section per slide: text card beside a picture (landscape) or under it
   (portrait). The figure shows assets/etiquette/<name>.png when it exists,
   otherwise the emoji badge. */
.etiquette-slide {
  display: flex;
  /* Picture on the left, text card on the right. */
  flex-direction: row-reverse;
  align-items: center;
  gap: 16px;
  width: 100%;
  height: 100%;
  min-height: 0;
}

.etiquette-card-wrap {
  flex: 11;
  min-width: 0;
  max-height: 100%;
  overflow-y: auto;
}

.etiquette-figure {
  flex: 9;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
}

.etiquette-figure img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 20px;
}

/* The same Material Icons font the Android app renders its badges with. */
@font-face {
  font-family: 'MaterialIconsOTM';
  src: url('webfonts/MaterialIcons-Regular.otf') format('opentype');
  font-display: block;
}

.etiquette-badge {
  width: clamp(90px, 36vmin, 340px);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 3px solid rgba(255, 106, 0, 0.85);
  /* Denser centre to match the Android app, where the glow also shines
     through behind the translucent badge fill. */
  background: radial-gradient(circle closest-side, rgba(255, 106, 0, 0.65) 0%, rgba(255, 106, 0, 0.4) 55%, rgba(0, 0, 0, 0.32) 100%);
  box-shadow: 0 0 36px 4px rgba(255, 106, 0, 0.35);
  font-family: 'MaterialIconsOTM';
  color: #fff;
  font-size: clamp(48px, 19vmin, 180px);
  line-height: 1;
}

.etiquette-figure.danger .etiquette-badge {
  border-color: rgba(229, 57, 53, 0.85);
  background: radial-gradient(circle closest-side, rgba(229, 57, 53, 0.65) 0%, rgba(229, 57, 53, 0.4) 55%, rgba(0, 0, 0, 0.32) 100%);
  box-shadow: 0 0 36px 4px rgba(229, 57, 53, 0.35);
}

@media (orientation: portrait) {
  .etiquette-slide {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .etiquette-card-wrap {
    flex: 3;
    width: 100%;
  }

  .etiquette-figure {
    flex: 2;
    width: 100%;
    align-self: center;
  }
}

.etiquette-card {
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 16px 18px 18px;
  color: #fff;
}

.etiquette-card h2 {
  margin: 0 0 10px;
  color: #ff6a00;
  font-size: clamp(17px, 2.2vw, 26px);
  font-weight: 800;
  letter-spacing: 0.5px;
}

.etiquette-card.danger h2 {
  color: #e53935;
}

.etiquette-card p,
.etiquette-card li {
  margin: 0;
  font-size: clamp(13px, 1.55vw, 20px);
  line-height: 1.35;
}

.etiquette-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.etiquette-card li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 7px;
}

.etiquette-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 0.34em;
  height: 0.34em;
  border-radius: 50%;
  background: #ff6a00;
}

.etiquette-card.danger li::before {
  background: #e53935;
}

.etiquette-card .etiquette-note {
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.7);
  font-style: italic;
  font-size: 0.92em;
  white-space: pre-line;
}

.etiquette-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 8px;
}

.etiquette-dots-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.etiquette-dots {
  display: flex;
  gap: 8px;
}

.etiquette-dots span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.38);
}

.etiquette-dots span.active {
  background: #ff6a00;
}

.etiquette-playpause {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.push-status {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

/* ------------------------------------------------------------------ */
/* Value tiles, appearance card, number pad, condensed/landscape layout */
/* ------------------------------------------------------------------ */

.value-tile {
  width: 100%;
  min-height: 0;
  text-align: left;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 8px 14px;
  border-radius: 10px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--tint-card-border, #333333);
  box-shadow: none;
}

.settings-hint {
  margin: -4px 0 10px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.38);
}

.settings-sublabel {
  margin: 12px 0 6px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.54);
}

.hex-input {
  width: 86px;
  padding: 6px 8px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--tint-card-border, #333333);
  border-radius: 8px;
  font-size: 12px;
  text-align: right;
  text-transform: uppercase;
}

.hex-input:focus {
  outline: none;
  border-color: var(--accent);
}

.numpad-content {
  width: min(360px, 100%);
}

.numpad-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.numpad-main {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.numpad-display-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.numpad-step {
  min-width: 0;
  width: 48px;
  height: 56px;
  padding: 0;
  font-size: 24px;
  border-radius: 12px;
  background: var(--tint-button-bg, #2d2d2d);
  border: 1px solid var(--tint-button-border, rgba(255, 255, 255, 0.3));
}

.numpad-display {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 56px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--tint-card-border, #333333);
}

.numpad-seg {
  min-width: 0;
  padding: 2px 8px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
  border-radius: 8px;
  color: #ffffff;
  background: transparent;
  border: 2px solid transparent;
  box-shadow: none;
}

.numpad-seg.active {
  border-color: var(--tint-button-border, var(--accent));
  background: rgba(255, 255, 255, 0.08);
}

.numpad-colon,
.numpad-num {
  font-size: 30px;
  font-weight: 700;
  letter-spacing: 2px;
}

.numpad-hint {
  margin: 0;
  font-size: 11px;
  text-align: center;
  color: rgba(255, 255, 255, 0.4);
}

.numpad-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.numpad-key {
  min-width: 0;
  min-height: 52px;
  font-size: 22px;
  font-weight: 700;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--tint-card-border, #333333);
  box-shadow: none;
}

.numpad-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.numpad-actions .wide-button {
  width: auto;
  margin-top: 0;
}

@media (orientation: landscape) {
  .numpad-content {
    width: min(620px, 100%);
  }

  .numpad-body {
    flex-direction: row;
    align-items: stretch;
  }

  .numpad-main {
    flex: 1;
    justify-content: space-between;
  }

  .numpad-keys {
    flex: 1;
    align-content: start;
  }

  .numpad-key {
    min-height: 44px;
  }

  /* Two-column settings so the panel needs far less scrolling when cast in
     landscape. Uses CSS multi-column (masonry-style) so each column packs
     tightly with no row-alignment gaps; full-width buttons span both columns. */
  #settings-modal .modal-content {
    width: min(840px, 100%);
  }

  #settings-form {
    column-count: 2;
    column-gap: 16px;
  }

  #settings-form > .settings-card {
    margin: 0 0 12px;
    break-inside: avoid;
  }

  #settings-form > .quick-save-row,
  #settings-form > .settings-actions {
    column-span: all;
    margin: 4px 0 12px;
  }
}

/* Etiquette nav: indicator flexes and falls back to a counter so Back/Next
   never get pushed off screen with many slides. */
.etiquette-dots-wrap {
  flex: 1;
  justify-content: center;
  min-width: 0;
  overflow: hidden;
}

.etiquette-counter {
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

/* Wall clock (parity with the Android app) — sits under the logo. */
.wall-clock {
  margin-top: 10px;
  font-size: clamp(20px, 4vw, 34px);
  font-weight: 700;
  letter-spacing: 2px;
  color: #f4f4f4;
  text-align: center;
  line-height: 1;
}

/* Layout-adjusted elements move as one unit. */
#logo-pane, #timer-pane, #control-row, #settings-row-main, #wall-clock {
  will-change: transform;
}

/* Mini screen preview inside the Screen Layout settings card — mirrors the
   Android settings preview: shows every movable element at its adjusted
   spot; tap one to select it. */
.layout-preview {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9; /* overridden inline to match the window/mode */
  background: #262626;
  border: 1px solid #3c3c3c;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px auto 12px;
}
.lp-el {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  border: 1px dashed transparent;
  border-radius: 6px;
  padding: 2px 4px;
}
.lp-el.selected {
  border-color: #00ff88;
}
.lp-logo { width: 26%; height: auto; }
.lp-clock { color: #f4f4f4; font-weight: 700; font-size: 11px; letter-spacing: 1px; }
.lp-timer { color: #00ff88; font-weight: 700; font-size: 22px; letter-spacing: 1px; }
.lp-buttons { display: flex; gap: 4px; }
.lp-buttons span {
  width: 22px;
  height: 9px;
  border-radius: 5px;
  background: #4a4a4a;
  display: inline-block;
}

.lp-buttons { flex-direction: column; align-items: center; gap: 3px; }
.lp-btn-row { display: flex; gap: 4px; }
.lp-btn-row span {
  width: 22px;
  height: 9px;
  border-radius: 5px;
  background: #4a4a4a;
  display: inline-block;
}
