:root,
[data-theme="midnight"] {
  color-scheme: dark;
  --bg: #1a1a1a;
  --bg-elevated: #242424;
  --bg-card: #2a2a2a;
  --text: #f5f5f5;
  --muted: #a3a3a3;
  --accent: #c084fc;
  --accent-strong: #a855f7;
  --success: #4ade80;
  --warn: #facc15;
  --danger: #f87171;
  --border: #3f3f3f;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --top-bar-bg: rgba(26, 26, 26, 0.95);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

[data-theme="ember"] {
  color-scheme: dark;
  --bg: #1c1410;
  --bg-elevated: #2a1c16;
  --bg-card: #32221a;
  --text: #f8efe6;
  --muted: #b8a090;
  --accent: #f0a060;
  --accent-strong: #e07830;
  --success: #6ecf8a;
  --warn: #f0c040;
  --danger: #f07060;
  --border: #4a3428;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --top-bar-bg: rgba(28, 20, 16, 0.95);
}

[data-theme="forest"] {
  color-scheme: dark;
  --bg: #121a16;
  --bg-elevated: #1a2620;
  --bg-card: #203028;
  --text: #e8f0ea;
  --muted: #8fa898;
  --accent: #5dba8a;
  --accent-strong: #3d9a6a;
  --success: #6ed49a;
  --warn: #d4c05a;
  --danger: #e07870;
  --border: #2e4038;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --top-bar-bg: rgba(18, 26, 22, 0.95);
}

[data-theme="slate"] {
  color-scheme: dark;
  --bg: #16181d;
  --bg-elevated: #1e2228;
  --bg-card: #262b33;
  --text: #eef0f4;
  --muted: #9aa3b0;
  --accent: #7eb0d8;
  --accent-strong: #5a94c0;
  --success: #5ecf9a;
  --warn: #e0c060;
  --danger: #e07070;
  --border: #3a414c;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
  --top-bar-bg: rgba(22, 24, 29, 0.95);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

#app {
  max-width: 720px;
  margin: 0 auto;
  min-height: 100vh;
  height: 100dvh;
  max-height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
  padding: calc(1rem + env(safe-area-inset-top, 0px)) 1.25rem 1rem;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--top-bar-bg, rgba(26, 26, 26, 0.95));
  backdrop-filter: blur(8px);
  z-index: 10;
}

.top-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.top-settings-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--accent);
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.top-settings-btn:hover {
  border-color: var(--accent);
}

.top-update-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--accent);
  border-radius: 999px;
  width: auto;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.7rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  line-height: 1;
  cursor: pointer;
}

.top-update-btn.needs-update {
  border-color: var(--accent);
  background: var(--accent);
  color: #111;
}

.top-update-btn.hidden {
  display: none;
}

.llm-api-config > summary {
  cursor: pointer;
  font-weight: 600;
}

.kiosk-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--bg, #111);
  display: flex;
  flex-direction: column;
  user-select: none;
  -webkit-user-select: none;
}

.kiosk-chrome {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: calc(0.55rem + env(safe-area-inset-top, 0px)) 0.7rem 0.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--top-bar-bg, rgba(26, 26, 26, 0.96));
  position: relative;
  z-index: 6;
  pointer-events: auto;
}

.kiosk-chrome input {
  flex: 1;
  min-width: 0;
}

.kiosk-title {
  flex: 1;
  min-width: 0;
  font-size: 0.92rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kiosk-timer {
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  font-size: 0.85rem;
}

.kiosk-body {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #0d0d0d;
  user-select: none;
  -webkit-user-select: none;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.kiosk-remote-stage {
  position: absolute;
  inset: 0;
  background: #111;
  touch-action: none;
  cursor: pointer;
}

.kiosk-remote-canvas,
.kiosk-remote-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  background: #111;
  touch-action: none;
  cursor: pointer;
}

.kiosk-blocked {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.2rem;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-weight: 600;
  pointer-events: auto;
}

.kiosk-drive-hint {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  top: 0.55rem;
  z-index: 3;
  margin: 0;
  font-size: 0.82rem;
  text-shadow: 0 1px 4px #000;
  pointer-events: none;
}

.kiosk-status {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: 0.6rem;
  z-index: 2;
  margin: 0;
  text-shadow: 0 1px 4px #000;
}

.kiosk-red-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: #c4122f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.kiosk-chrome .ghost-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.kiosk-taken .kiosk-chrome {
  display: none;
}

.kiosk-wiki {
  position: absolute;
  inset: 0;
  overflow: auto;
  padding: 1rem 1.1rem 2rem;
  color: var(--text);
}

.kiosk-wiki h1 { font-size: 1.35rem; margin: 0 0 0.6rem; }
.kiosk-wiki h2 { font-size: 1.12rem; margin: 1.1rem 0 0.4rem; }
.kiosk-wiki p, .kiosk-wiki li { line-height: 1.45; }
.kiosk-wiki img { max-width: 100%; border-radius: 8px; margin: 0.5rem 0; }
.kiosk-wiki table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin: 0.6rem 0; }
.kiosk-wiki th, .kiosk-wiki td { border: 1px solid var(--border); padding: 0.35rem 0.45rem; text-align: left; }
.kiosk-wiki a { color: var(--accent); }
.kiosk-wiki hr { border: 0; border-top: 1px solid var(--border); margin: 1rem 0; }
.kiosk-wiki ol { padding-left: 1.25rem; }
.kiosk-wiki pre.mermaid,
.kiosk-wiki .mermaid {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.65rem;
  margin: 0.75rem 0;
  overflow: auto;
}
.kiosk-wiki pre.mermaid-fallback,
.kiosk-wiki pre.wiki-code {
  font-size: 0.78rem;
  white-space: pre-wrap;
}
.kiosk-fallback {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.75rem;
  padding: 1.25rem;
}

.theme-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.theme-option {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  text-align: left;
}

.theme-option.active {
  border-color: var(--accent);
  color: var(--accent);
}

.theme-option .theme-swatch {
  display: block;
  height: 0.45rem;
  border-radius: 999px;
  margin-bottom: 0.4rem;
  background: linear-gradient(90deg, var(--swatch-a), var(--swatch-b));
}

.icon-style-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.icon-style-option {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius);
  padding: 0.55rem 0.65rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.icon-style-option.active {
  border-color: var(--accent);
  color: var(--accent);
}

.icon-style-preview {
  width: 2.7rem;
  height: 2.7rem;
  border-radius: 0.7rem;
  flex-shrink: 0;
  background: var(--bg-card);
}

.icon-style-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.icon-style-copy strong {
  font-size: 0.92rem;
}

.icon-style-sheet-backdrop {
  align-items: center;
  z-index: 95;
}

.icon-style-sheet {
  width: min(26rem, 100%);
  margin-bottom: 0;
}

.task-timeline-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: var(--bg-card);
}

.task-timeline-section summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: baseline;
}

.task-timeline-section summary::-webkit-details-marker {
  display: none;
}

.task-timeline-section summary::before {
  content: "▸ ";
  color: var(--muted);
}

.task-timeline-section[open] summary::before {
  content: "▾ ";
}

.task-timeline-count {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.9em;
}

.task-item.task-actionable {
  cursor: pointer;
}

.task-item.task-actionable:hover {
  border-color: var(--accent);
}

.ai-mark {
  color: var(--accent);
  margin-right: 0.25rem;
}

.ai-only::before,
.ai-optional::before {
  content: "✦ ";
  color: var(--accent);
}

html[data-ai="off"] .ai-only {
  display: none !important;
}

.interview-table {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.interview-table-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.interview-table-row textarea {
  min-height: 4.5rem;
}

.standing-target-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: flex-end;
}
.standing-target-row label {
  flex: 1 1 7rem;
}
.standing-trend {
  font-size: 0.85rem;
}
.standing-trend.off {
  color: var(--danger);
}

.assistant-domme-fab-host {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right));
  bottom: calc(4.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 25;
  touch-action: none;
}
.assistant-domme-fab-host.placed {
  right: auto;
  bottom: auto;
}
.assistant-domme-fab {
  position: relative;
  min-width: 3.15rem;
  height: 3.15rem;
  padding: 0 0.85rem 0 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  cursor: grab;
}
.assistant-domme-fab:active {
  cursor: grabbing;
}
.assistant-domme-fab-hide {
  position: absolute;
  top: -0.4rem;
  left: -0.4rem;
  width: 1.2rem;
  height: 1.2rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1;
  z-index: 1;
}
.assistant-domme-show-tab {
  position: fixed;
  right: 0;
  bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 25;
  width: 1.65rem;
  height: 2.4rem;
  padding: 0;
  border-radius: 0.6rem 0 0 0.6rem;
  border: 1px solid var(--border);
  border-right: 0;
  background: var(--bg-elevated);
  color: var(--accent);
  font-size: 0.95rem;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}
.assistant-domme-show-tab.has-nag {
  color: #2dd4bf;
  border-color: #2dd4bf;
}
.assistant-domme-fab-icon {
  font-size: 1.15rem;
  line-height: 1;
}
.assistant-domme-fab-label {
  letter-spacing: 0.02em;
}
.assistant-domme-fab.has-nag {
  border-color: var(--accent);
}
.assistant-domme-fab.on-context {
  color: #2dd4bf;
  border-color: #2dd4bf;
}
.assistant-domme-fab.on-context.has-nag {
  border-color: #2dd4bf;
}
.assistant-domme-fab.on-context .assistant-domme-fab-badge {
  background: #2dd4bf;
  color: #042f2e;
}
.assistant-domme-fab-badge {
  position: absolute;
  top: -0.25rem;
  right: -0.25rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--accent);
  color: #111;
  font-size: 0.7rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}
.assistant-domme-sheet.page-context .assistant-domme-index,
.assistant-domme-sheet.page-context .assistant-example-prompts,
.assistant-domme-sheet.page-context .assistant-permissions,
.assistant-domme-sheet.page-context .assistant-changes,
.assistant-domme-sheet.page-context .assistant-chat-tools {
  display: none;
}

.assistant-domme-sheet {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 720px;
  max-height: min(86vh, 40rem);
  z-index: 30;
  background: var(--bg-elevated);
  border-top: 1px solid var(--border);
  border-radius: 1rem 1rem 0 0;
  padding: 0.75rem 0.85rem calc(0.85rem + env(safe-area-inset-bottom));
  overflow: auto;
}
.assistant-domme-index {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.35rem 0 0.6rem;
}
.assistant-subject-btn {
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}
.assistant-subject-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}
.assistant-subject-btn.nag {
  box-shadow: 0 0 0 1px var(--accent);
}
.assistant-subject-dot {
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  margin-left: 0.3rem;
  border-radius: 999px;
  background: var(--accent);
  vertical-align: middle;
}
.assistant-domme-log {
  max-height: 16rem;
  overflow: auto;
  margin: 0.5rem 0;
}
.assistant-suggestion-card {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 0.55rem 0.7rem;
  margin: 0.35rem 0 0.6rem;
}
.assistant-domme-input {
  width: 100%;
  margin-bottom: 0.5rem;
}

.assistant-domme-page {
  position: relative;
  left: auto;
  transform: none;
  bottom: auto;
  max-height: none;
  width: 100%;
  background: transparent;
  border: 0;
  border-radius: 0;
  padding: 0;
  overflow: visible;
}
.assistant-example-prompts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.6rem;
}
.assistant-prompt-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: inherit;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.78rem;
}
.assistant-permissions,
.assistant-changes {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.45rem 0.65rem;
  margin: 0.35rem 0;
}
.assistant-perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin: 0.35rem 0;
}
.assistant-perm-row select {
  max-width: 11rem;
}
.assistant-change-row {
  font-size: 0.85rem;
  margin: 0.25rem 0;
}
.assistant-chat-entry {
  margin: 0.35rem 0 0.6rem;
}

.act-manual-form textarea {
  min-height: 3.5rem;
}

.task-bulk-bar {
  position: sticky;
  bottom: calc(4.5rem + env(safe-area-inset-bottom, 0px));
  z-index: 5;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.75rem;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.08em;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  flex: 1;
}

.dom-goal-meters {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  min-width: 0;
}

.dom-goal-meters.hidden {
  display: none;
}

.dom-goal-chip {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.1;
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  cursor: pointer;
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dom-goal-chip.tone-primary {
  color: var(--accent);
}

.dom-goal-chip.tone-gift {
  color: #c4a35a;
}

.dom-goal-chip.ready {
  font-weight: 700;
}

.dom-goal-chip.revealed {
  background: color-mix(in srgb, var(--border) 70%, transparent);
  max-width: 16rem;
  white-space: normal;
}

.goal-archived {
  opacity: 0.78;
}

.goal-metric-preview {
  margin: 0;
  font-size: 0.9em;
}

.goal-complex-warn {
  color: var(--warn, #c97b4a);
  font-size: 0.85rem;
}

.view {
  flex: 1;
  padding: 1.25rem;
  padding-bottom: 5.5rem;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

body.auth-screen #app {
  max-width: none;
}

body.auth-screen .view {
  padding: 0;
  padding-bottom: 0;
  display: flex;
  align-items: stretch;
  min-height: 100vh;
}

.auth-splash {
  flex: 1;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem;
  background:
    radial-gradient(ellipse 80% 60% at 20% 10%, rgba(163, 163, 163, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 80%, rgba(120, 120, 120, 0.1), transparent 50%),
    linear-gradient(165deg, #161616 0%, #1f1f1f 45%, #141414 100%);
}

.auth-card {
  width: min(100%, 400px);
  background: rgba(42, 42, 42, 0.92);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  box-shadow: var(--shadow);
  padding: 1.75rem 1.5rem;
}

.auth-card h1 {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.auth-card .muted {
  margin-top: 0;
}

.hidden {
  display: none !important;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.muted {
  color: var(--muted);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.6rem;
}

h2 {
  font-size: 1.2rem;
}

label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.95rem;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 10px;
  padding: 0.75rem 0.85rem;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.primary-btn,
.ghost-btn,
.choice-btn {
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.1rem;
  cursor: pointer;
}

.primary-btn {
  background: linear-gradient(135deg, var(--accent-strong), var(--accent));
  color: #111;
  font-weight: 700;
  text-decoration: none;
}

.primary-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.ghost-btn {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  text-decoration: none;
}

.choice-btn {
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  text-align: left;
}

.choice-btn.active-want {
  border-color: var(--success);
  background: rgba(74, 222, 128, 0.12);
}

.choice-btn.active-if {
  border-color: var(--warn);
  background: rgba(250, 204, 21, 0.12);
}

.choice-btn.active-not {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
}

.choice-btn.active-none,
.rating-box.active-none {
  border-color: var(--border);
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
}

.interest-key {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1rem;
}

.interest-key .key-item {
  font-size: 0.8rem;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.interest-key .key-item.want {
  border-color: var(--success);
  background: rgba(74, 222, 128, 0.12);
}

.interest-key .key-item.if {
  border-color: var(--warn);
  background: rgba(250, 204, 21, 0.12);
}

.interest-key .key-item.not {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
}

.interest-key .key-item.none {
  opacity: 0.85;
}

.interest-rating {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.5rem;
}

.rating-box {
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.35rem;
  font-size: 0.85rem;
  background: var(--surface);
  cursor: pointer;
  text-align: center;
}

.rating-box.active-want {
  border-color: var(--success);
  background: rgba(74, 222, 128, 0.12);
}

.rating-box.active-if {
  border-color: var(--warn);
  background: rgba(250, 204, 21, 0.12);
}

.rating-box.active-not {
  border-color: var(--danger);
  background: rgba(248, 113, 113, 0.12);
}

.help-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.help-btn {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  font-weight: 700;
  flex-shrink: 0;
}

.help-popover {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 20;
  margin-top: 0.35rem;
  min-width: 240px;
  max-width: 320px;
  padding: 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-size: 0.85rem;
}

.onboarding-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.5rem;
}

.onboarding-step {
  font-size: 0.75rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  opacity: 0.6;
}

.onboarding-step.active {
  border-color: var(--accent);
  opacity: 1;
}

.onboarding-step.done {
  border-color: var(--success);
  opacity: 0.9;
}

.history-footer-links {
  text-align: center;
  font-size: 0.85rem;
  opacity: 0.85;
  padding: 0.5rem 0 1rem;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  padding: 0;
  text-decoration: underline;
}

.inline-link {
  display: inline-block;
  text-align: center;
  text-decoration: none;
  margin: 0.5rem 0;
}

.suggested-agreement {
  border-left: 3px solid var(--accent);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border-radius: 999px;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
  border: 1px solid var(--border);
}

.pill.ok {
  border-color: var(--success);
  color: var(--success);
}

.pill.pending {
  border-color: var(--warn);
  color: var(--warn);
}

.row {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.title-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.title-row h1 {
  margin: 0;
}

.pie-chart {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}

.pie-chart-inner {
  display: block;
  border-radius: 50%;
  background: var(--bg-elevated);
}

.tab.tab-pie {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.75rem 0.4rem 0.55rem;
}

.tab.tab-pie.active .pie-chart-inner {
  background: var(--bg);
}

.tab-label {
  white-space: nowrap;
}

.tab {
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  padding: 0.45rem 0.8rem;
  cursor: pointer;
}

.tab.active {
  border-color: var(--accent);
  color: var(--accent);
}

.interest-item {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.interest-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.45rem;
}

.task-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.task-item.done {
  opacity: 0.7;
}

.error {
  color: var(--danger);
  font-size: 0.9rem;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 720px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.25rem;
  padding: 0.5rem 0.75rem calc(0.65rem + env(safe-area-inset-bottom));
  background: rgba(20, 20, 20, 0.98);
  border-top: 1px solid var(--border);
  z-index: 20;
}

.nav-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.45rem 0.25rem;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 0.68rem;
  cursor: pointer;
}

.nav-tab .nav-icon {
  font-size: 1.15rem;
  line-height: 1;
}

.nav-tab.active {
  color: var(--accent);
}

.nav-tab.disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.facet-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}

.facet-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.75rem;
  align-items: center;
  width: 100%;
  padding: 0.95rem 1rem;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.facet-row:last-child {
  border-bottom: none;
}

.facet-row.disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.facet-row.punish-pending {
  background: color-mix(in srgb, #eab308 22%, var(--bg-card));
  border-left: 3px solid #eab308;
}
.facet-row.punish-assigned {
  background: color-mix(in srgb, #3b82f6 24%, var(--bg-card));
  border-left: 3px solid #3b82f6;
}
.facet-row.punish-covered {
  background: color-mix(in srgb, #94a3b8 16%, var(--bg-card));
  color: color-mix(in srgb, var(--text) 72%, #94a3b8);
  border-left: 3px solid #94a3b8;
}
.facet-row.punish-remind {
  background: color-mix(in srgb, #f472b6 26%, var(--bg-card));
  border-left: 3px solid #f472b6;
}

.punishment-recent {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.65rem 0.55rem;
  background: var(--bg-card);
}
.punishment-recent summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.45rem 0.2rem;
}

.facet-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--bg-elevated);
  font-size: 1rem;
}

.facet-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.facet-title {
  font-weight: 600;
  font-size: 0.98rem;
}

.facet-subtitle {
  color: var(--muted);
  font-size: 0.82rem;
}

.facet-chevron {
  color: var(--muted);
  font-size: 1.1rem;
}

.facet-section {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.facet-section-title {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.gear-item .gear-flags {
  gap: 1rem;
}

.vault-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 0.75rem;
}

.vault-card {
  min-width: 0;
}

.vault-card.vault-highlight {
  outline: 2px solid var(--accent, #6ee7b7);
  outline-offset: 2px;
}

.vault-image {
  width: 100%;
  border-radius: 10px;
  display: block;
  max-height: 240px;
  object-fit: cover;
  background: var(--bg-elevated);
}

.vault-image.blurred {
  filter: blur(18px);
}

.csv-import-preview {
  margin-top: 0.5rem;
  padding: 0.75rem;
  border: 1px dashed var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
}

.csv-preview-list {
  max-height: 16rem;
  overflow-y: auto;
  gap: 0.35rem;
}

.csv-preview-row {
  font-size: 0.9rem;
  line-height: 1.35;
  padding: 0.25rem 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}

.csv-preview-row-error {
  color: var(--danger, #f87171);
}

.chat-screen {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  min-width: 0;
  height: 100%;
  gap: 0.5rem;
  overflow: hidden;
}

.view.chat-view {
  display: flex;
  flex-direction: column;
  padding: 0.75rem 1rem calc(3.75rem + env(safe-area-inset-bottom, 0px));
  min-height: 0;
  min-width: 0;
  flex: 1;
  height: auto;
  max-height: none;
  overflow: hidden;
}

.chat-log {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.25rem 0 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.chat-header-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 6;
  background: var(--bg, #121212);
}

.chat-composer-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  z-index: 6;
  background: var(--bg, #121212);
}

.chat-vault-link {
  font-size: 0.9rem;
  padding: 0;
  text-align: left;
}

.chat-header {
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  min-width: 0;
}

.chat-header h1 {
  margin: 0;
  font-size: 1.15rem;
}

.chat-settings-link {
  font-size: 1.2rem;
  padding: 0.35rem 0.55rem;
}

.chat-composer {
  flex-shrink: 0;
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.55rem 0 0.15rem;
  margin-bottom: 0;
  background: transparent;
  border-top: 1px solid var(--border);
}

.chat-input {
  flex: 1;
  min-height: 2.5rem;
  max-height: 7rem;
  resize: none;
  border-radius: 18px;
  padding: 0.65rem 0.85rem;
}

.chat-icon-btn,
.chat-send-btn {
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chat-send-btn {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
  font-size: 1rem;
}

.chat-icon-btn:hover,
.chat-send-btn:hover {
  filter: brightness(1.08);
}

.row.wrap {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chat-bubble {
  flex-shrink: 0;
  border-radius: 14px;
  padding: 0.75rem 0.9rem;
  max-width: min(92%, 100%);
  min-width: 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
}

.chat-bubble-text,
.chat-text-link {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-text-link {
  color: var(--accent, #c4a1ff);
  font-weight: 600;
}

.chat-bubble.assistant {
  background: var(--bg-elevated);
  align-self: flex-start;
}

.chat-bubble.user {
  background: rgba(168, 85, 247, 0.2);
  align-self: flex-end;
}

.chat-bubble.has-bubble-tint {
  background: rgba(168, 85, 247, 0.42);
}

.chat-system-event,
.chat-log-line {
  flex-shrink: 0;
  align-self: flex-end;
  max-width: min(88%, 100%);
  min-width: 0;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.15rem 0.35rem;
  margin: 0;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
  background: none;
  border: none;
  border-radius: 0;
}

.chat-system-event strong,
.chat-log-line strong {
  color: var(--text);
  font-weight: 600;
}

.chat-action-link {
  display: inline;
  margin: 0 0.15rem;
  padding: 0;
  border: none;
  background: none;
  color: var(--accent, #c4a1ff);
  font: inherit;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.chat-edited-flag {
  display: block;
  font-size: 0.7rem;
  margin-top: 0.25rem;
}

.chat-bubble-own {
  -webkit-touch-callout: none;
}

.chat-image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin-top: 0.35rem;
}

.chat-image-wrap .chat-image {
  margin-top: 0;
}

.chat-image-zoom-btn {
  position: absolute;
  top: 0.3rem;
  right: 0.3rem;
  width: 1.85rem;
  height: 1.85rem;
  border: none;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.62);
  color: #fff;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  touch-action: manipulation;
}

.chat-image-zoom-btn:hover,
.chat-image-zoom-btn:focus-visible {
  background: rgba(8, 8, 12, 0.85);
}

.chat-image {
  max-width: min(100%, 12.5rem);
  max-height: 10rem;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  margin-top: 0.35rem;
  display: block;
  cursor: default;
  transition: filter 0.2s ease;
}

.chat-image.blurred {
  filter: blur(18px);
}

.chat-image-viewer {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.86);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  cursor: default;
}

.chat-image-viewer-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 10px;
}

.chat-image-viewer-img.blurred {
  filter: blur(18px);
}

.chat-image-viewer-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 999px;
  background: rgba(8, 8, 12, 0.7);
  color: #fff;
  font-size: 1.15rem;
  cursor: pointer;
  z-index: 2;
}

.chat-bubble-color-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0.15rem 0 0.65rem;
}

.chat-bubble-color-swatch {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  border: 2px solid var(--border);
  padding: 0;
  cursor: pointer;
}

.chat-bubble-color-swatch.selected {
  border-color: var(--text);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--text) 35%, transparent);
}

.chat-bubble-color-row input[type="color"] {
  width: 2.2rem;
  height: 1.85rem;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
}

.chat-lock-image-row {
  font-size: 0.85rem;
  margin: 0 0.25rem;
}

.chat-crypto-placeholder .link-btn,
.link-btn {
  background: none;
  border: none;
  color: var(--accent, #c97b4a);
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font: inherit;
}

.chat-settings label.row {
  align-items: center;
  gap: 0.5rem;
}

.task-calendar {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.task-cal-row {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

.task-cal-date {
  font-size: 0.8rem;
  color: var(--muted);
}

.task-cal-body {
  font-weight: 500;
}

.tag-picker .tag-chip {
  cursor: pointer;
}

.org-chart {
  display: flex;
  gap: 0.5rem;
  align-items: flex-end;
  height: 120px;
  margin-top: 0.5rem;
}

.org-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  height: 100%;
  justify-content: flex-end;
}

.org-bar {
  width: 100%;
  max-width: 72px;
  border-radius: 10px 10px 4px 4px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  min-height: 8px;
}

.lockup-status.locked {
  border-color: rgba(168, 85, 247, 0.45);
}

.lockup-timer {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0.25rem 0;
}

.lockup-timer.break {
  color: #f0b429;
}

.lockup-hero {
  text-align: center;
  padding: 1.25rem;
}

.lockup-hero.locked {
  border-color: rgba(31, 55, 128, 0.55);
  background: rgba(31, 55, 128, 0.12);
}

.lockup-hero-text {
  margin: 0 0 0.5rem;
}

.chastity-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.chastity-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.chastity-stat.wide {
  grid-column: 1 / -1;
}

.chastity-stat-value {
  font-size: 1.35rem;
  font-weight: 700;
}

.chastity-actions {
  gap: 0.5rem;
  flex-wrap: wrap;
}

.chastity-flow-host {
  margin-top: 0.25rem;
}

.chastity-flow-header h2 {
  margin: 0;
}

.option-card {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius, 12px);
  padding: 0.85rem 1rem;
  cursor: pointer;
}

.option-card:hover {
  border-color: var(--accent);
}

.option-card strong {
  display: block;
  margin-bottom: 0.25rem;
}

.time-shortcuts {
  gap: 0.35rem;
}

.time-selector input[type="datetime-local"] {
  min-height: 2.75rem;
}

.time-shortcut-btn {
  font-size: 0.8rem;
  padding: 0.25rem 0.55rem;
}

.break-type-picker .tag-chip {
  font-size: 0.82rem;
}

.sex-time-fields {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
  margin-top: 0.25rem;
}

.pill.locked-pill {
  background: rgba(168, 85, 247, 0.25);
  color: var(--text);
}

.tag-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.tag-chip {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
}

.tag-chip.active {
  background: rgba(168, 85, 247, 0.25);
  border-color: rgba(168, 85, 247, 0.5);
}

.compare-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr 2.5rem;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.compare-bar-wrap {
  height: 12px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.compare-bar.org {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-strong));
  border-radius: 6px;
}

.compare-bar.alt {
  height: 100%;
  background: linear-gradient(90deg, #6b8cff, #3b5bdb);
  border-radius: 6px;
}

.compare-bar.warn {
  height: 100%;
  background: linear-gradient(90deg, #c4a35a, #a67c2d);
  border-radius: 6px;
}

.metric-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.65rem;
}

.metric-tile {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 0.7rem 0.75rem;
  text-align: center;
}

.metric-tile-value {
  font-size: 1.25rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.metric-tile-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.2rem;
  line-height: 1.25;
}

.metric-tile-hint {
  font-size: 0.65rem;
  color: var(--muted);
  opacity: 0.85;
  margin-top: 0.15rem;
}

.chart-subhead {
  font-size: 0.85rem;
  margin: 0.75rem 0 0.35rem;
  color: var(--muted);
  font-weight: 600;
}

.history-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.25rem;
}

.history-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.history-legend-item::before {
  content: "";
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
}

.history-legend-item.p1::before {
  background: linear-gradient(180deg, #6b8cff, #3b5bdb);
}

.history-chart {
  display: flex;
  gap: 0.35rem;
  align-items: flex-end;
  height: 140px;
  overflow-x: auto;
  padding-top: 0.5rem;
}

.history-chart.tall {
  height: 180px;
}

.history-week {
  flex: 1;
  min-width: 36px;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  position: relative;
}

.history-week-bars {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  min-height: 0;
}

.history-week-label {
  font-size: 0.65rem;
  color: var(--muted);
  order: 2;
}

.history-week-bar {
  width: 45%;
  max-width: 14px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--accent), var(--accent-strong));
  min-height: 2px;
  align-self: flex-end;
}

.history-week-bar.p1 {
  background: linear-gradient(180deg, #6b8cff, #3b5bdb);
}

.history-chastity-overlay {
  position: absolute;
  bottom: 1.2rem;
  width: 90%;
  background: rgba(31, 55, 128, 0.25);
  border-radius: 4px;
  pointer-events: none;
}

.chastity-overlay-label {
  margin-top: -0.25rem;
  margin-bottom: 0.5rem;
}

.feature-index {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.feature-index-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.feature-index-group h3 {
  margin: 0.15rem 0 0.2rem;
  font-size: 0.95rem;
}

.feature-index-presets {
  margin: 0.1rem 0 0.35rem;
}

.feature-index-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.5rem 0.1rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.feature-index-row input[type="checkbox"] {
  margin-top: 0.25rem;
  flex-shrink: 0;
  width: 1.05rem;
  height: 1.05rem;
}

.feature-index-copy {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}

.feature-index-copy strong {
  font-weight: 650;
}

.checkbox-label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0;
  width: 1.05rem;
  height: 1.05rem;
}

.brand-link {
  cursor: pointer;
}

.brand-link:hover,
.brand-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.facet-section-toggle {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  padding: 0.35rem 0;
  cursor: pointer;
}

.feelings-stage {
  display: block;
  width: 100%;
}

.feelings-wheel-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
  min-width: 0;
  position: relative;
}

.feelings-wheel-host {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-height: min(70vh, 640px);
  margin: 0;
  overflow: hidden;
  position: relative;
  border-radius: 10px;
  background: #1c1c1c;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.feelings-wheel-svg {
  display: block;
  position: absolute;
  /* Zoom ~2.4×; pin wheel center to bottom-left of the viewport */
  width: 240%;
  max-width: none;
  height: auto;
  left: 10%;
  top: 90%;
  transform: translate(-50%, -50%);
  cursor: grab;
  overflow: visible;
}

.feelings-wheel-svg.dragging {
  cursor: grabbing;
}

.feelings-wheel-seg {
  stroke: #0d0d0d;
  stroke-width: 0.9;
  cursor: pointer;
  transition: filter 0.12s ease, stroke-width 0.12s ease;
}

.feelings-wheel-seg:hover {
  filter: brightness(1.1);
}

.feelings-wheel-seg.selected {
  stroke: #f5f5f5;
  stroke-width: 2;
  filter: brightness(1.15) saturate(1.1);
}

.feelings-wheel-label {
  fill: #111;
  font-size: 13px;
  font-weight: 700;
  pointer-events: none;
}

.feelings-wheel-label-mid {
  fill: #f4f4f4;
  font-size: 10px;
  font-weight: 600;
  pointer-events: none;
}

.feelings-wheel-label-sm {
  fill: #f0f0f0;
  font-size: 8.5px;
  font-weight: 500;
  pointer-events: none;
}

.feelings-wheel-hub {
  fill: #f0f0f0;
  font-size: 20px;
  font-weight: 700;
  pointer-events: none;
}

.feelings-wheel-hub-disk {
  pointer-events: none;
}

.feelings-wheel-controls {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.feelings-detail-panel {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 6;
  width: min(17rem, 48%);
  max-height: min(42%, 14rem);
  overflow: auto;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(12, 12, 14, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.35);
  color: #f2f2f2;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.feelings-detail-panel.visible {
  opacity: 1;
  transform: translateY(0);
}

.feelings-detail-title {
  margin: 0 0 0.2rem;
  font-size: 1.05rem;
}

.feelings-detail-path {
  margin: 0 0 0.55rem;
  font-size: 0.8rem;
  color: rgba(220, 220, 220, 0.75);
}

.feelings-detail-body {
  margin: 0;
  line-height: 1.4;
  font-size: 0.88rem;
  white-space: pre-wrap;
}

.feelings-term {
  background: #0b0b0b;
  border: 1px solid #2a2a2a;
  border-radius: 6px;
  overflow: hidden;
  font-family: ui-monospace, "Cascadia Code", "Consolas", monospace;
}

.feelings-term-bar {
  background: #1a1a1a;
  color: #8a8a8a;
  font-size: 0.75rem;
  padding: 0.35rem 0.65rem;
  border-bottom: 1px solid #2a2a2a;
}

.feelings-term-log {
  margin: 0;
  padding: 0.65rem 0.75rem;
  min-height: 5rem;
  max-height: 10rem;
  overflow: auto;
  color: #c8e6c9;
  font-size: 0.8rem;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}

.feelings-event-banner {
  margin: 0;
  padding: 0.65rem 0.8rem;
  border-radius: 8px;
  border: 1px solid rgba(167, 139, 250, 0.35);
  background: rgba(167, 139, 250, 0.12);
  color: #e8e0ff;
  font-size: 0.9rem;
}

.feelings-when {
  gap: 0.45rem;
}

.feelings-when-row {
  align-items: center;
  gap: 0.55rem;
}

.feelings-when-label {
  color: #cfcfcf;
  font-size: 0.92rem;
}

.feelings-horny .feelings-horny-range {
  width: 100%;
  accent-color: var(--accent, #c97b4a);
}

.feelings-wheel-layers {
  align-items: center;
  gap: 0.75rem;
}

.feelings-cal {
  background: #121212;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  padding: 0.55rem 0.65rem 0.7rem;
}

.feelings-cal-title {
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.45rem;
}

.feelings-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0.2rem;
}

.feelings-cal-dow {
  text-align: center;
  font-size: 0.68rem;
  color: #888;
  padding: 0.15rem 0;
}

.feelings-cal-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.15rem;
  min-height: 2.35rem;
  padding: 0.2rem 0.1rem 0.25rem;
  border: 1px solid transparent;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.feelings-cal-cell.empty {
  pointer-events: none;
  min-height: 0;
  padding: 0;
}

.feelings-cal-cell.selected {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.06);
}

.feelings-cal-num {
  font-size: 0.82rem;
  line-height: 1;
}

.feelings-cal-dots {
  display: flex;
  gap: 0.18rem;
  align-items: center;
  justify-content: center;
  min-height: 0.45rem;
}

.feelings-cal-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  box-sizing: border-box;
}

.feelings-cal-dot.filled {
  border: none;
}

.feelings-cal-dot.outline {
  background: transparent;
  border: 1.5px solid #8a8a8a;
}

.feelings-cal-legend {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
}

/* Phone landscape: prioritize the cropped wheel */
@media (orientation: landscape) and (max-height: 520px) {
  .feelings-page > h1 {
    font-size: 1.05rem;
    margin: 0.15rem 0;
  }

  .feelings-page > .feelings-hint {
    display: none;
  }

  .feelings-when {
    margin: 0.15rem 0 0.35rem;
  }

  .feelings-cal {
    display: none;
  }

  .feelings-wheel-host {
    aspect-ratio: auto;
    height: calc(100dvh - 9.5rem);
    max-height: none;
  }

  .feelings-wheel-svg {
    width: 200%;
    left: 6%;
    top: 94%;
  }

  .feelings-detail-panel {
    width: min(15rem, 42%);
    max-height: 55%;
    top: 0.45rem;
    right: 0.45rem;
    padding: 0.55rem 0.7rem;
  }

  .feelings-wheel-controls {
    gap: 0.35rem;
  }

  .feelings-term-log {
    min-height: 2.75rem;
    max-height: 4.25rem;
    padding: 0.4rem 0.55rem;
  }
}

.chat-header-wrap {
  position: relative;
}

.chat-header-actions {
  display: flex;
  gap: 0.25rem;
  align-items: flex-start;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.chat-mini-toggle,
.chat-logs-toggle {
  font-size: 0.68rem;
  line-height: 1.1;
  padding: 0.22rem 0.4rem;
  min-height: 0;
  white-space: nowrap;
}

.chat-mini-toggle.active,
.chat-logs-toggle.active {
  border-color: var(--accent, #a78bfa);
  color: var(--accent, #a78bfa);
}

.chat-image-protected {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-user-drag: none;
  touch-action: none;
}

.chat-composer-wrap {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.chat-typing {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-height: 1.35rem;
  padding: 0 0.35rem 0.1rem;
  color: var(--muted);
  font-size: 0.78rem;
}

.chat-typing.hidden {
  display: none;
}

.chat-typing-dots {
  display: inline-flex;
  gap: 0.28rem;
  align-items: center;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg-elevated) 80%, var(--accent) 20%);
  border: 1px solid var(--border);
}

.chat-typing-dot {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
  display: block;
  animation: chat-typing-wave 1.05s infinite ease-in-out;
}

.chat-typing-dot:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-typing-dot:nth-child(3) {
  animation-delay: 0.3s;
}

.chat-typing-bubble {
  align-self: flex-start;
  max-width: 70%;
  gap: 0.35rem;
}

.chat-typing-bubble .chat-typing-dots {
  margin-top: 0.15rem;
  width: fit-content;
}

@keyframes chat-typing-wave {
  0%,
  60%,
  100% {
    transform: translateY(0);
    opacity: 0.35;
  }
  30% {
    transform: translateY(-0.32rem);
    opacity: 1;
  }
}

.chat-image-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1rem;
}

.chat-image-sheet {
  width: min(24rem, 100%);
  margin-bottom: 0.5rem;
}

.chat-settings-dropdown {
  position: absolute;
  right: 0;
  top: 100%;
  z-index: 20;
  width: min(320px, 92vw);
  padding: 0.85rem;
  background: var(--bg-elevated, #222);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.chat-settings-dropdown.hidden {
  display: none;
}

.chat-system-event {
  align-self: center;
  max-width: 96%;
  text-align: center;
  font-size: 0.82rem;
  color: var(--muted);
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px dashed var(--border);
  line-height: 1.4;
  white-space: pre-wrap;
}

.chat-log-line {
  flex-shrink: 0;
  align-self: flex-end;
  max-width: min(88%, 100%);
  min-width: 0;
  text-align: right;
  font-size: 0.75rem;
  color: var(--muted);
  padding: 0.15rem 0.35rem;
  margin: 0;
  line-height: 1.35;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
  overflow: visible;
  background: none;
  border: none;
  border-radius: 0;
}

.chat-log-group {
  flex-shrink: 0;
  align-self: flex-end;
  width: min(88%, 100%);
  max-width: min(88%, 100%);
  min-width: 0;
  text-align: right;
}

.chat-log-group-toggle {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.12rem;
  width: 100%;
  padding: 0.2rem 0.35rem;
  border: none;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 0.75rem;
  line-height: 1.35;
  cursor: pointer;
  text-align: right;
}

.chat-log-group-toggle:hover {
  color: var(--text);
}

.chat-log-group-title {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chat-log-group-chevron {
  color: var(--accent, #c4a1ff);
  font-weight: 600;
}

.chat-log-group-preview {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-log-group.expanded .chat-log-group-preview {
  display: none;
}

.chat-log-group-body {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  padding: 0.1rem 0 0.2rem;
}

.chat-log-group-body .chat-log-line {
  max-width: 100%;
  align-self: stretch;
}

.chat-log-punishment-pending,
.chat-log-punishment-pending strong,
.chat-log-group-punishment-pending .chat-log-group-toggle,
.chat-log-group-punishment-pending .chat-log-group-toggle strong,
.chat-log-group-punishment-pending .chat-log-group-preview,
.chat-log-group-punishment-pending .chat-log-group-chevron,
.chat-log-punishment-pending .chat-action-link {
  color: var(--danger, #f87171);
}

button.chat-log-line {
  display: block;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.chat-log-line:hover {
  color: var(--text);
}

.chat-settings-request .chat-request-actions {
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.settings-section {
  margin-top: 0.5rem;
}

.settings-section > summary.settings-section-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.settings-section > summary::-webkit-details-marker {
  display: none;
}

.settings-help-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.settings-help-btn {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}

.settings-help {
  flex: 1 1 100%;
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
}

.settings-checklist .choice-btn {
  text-align: left;
}

.cum-chart-wrap {
  width: 100%;
}

.cum-line-chart {
  width: 100%;
  height: auto;
  display: block;
}

.cum-axis {
  stroke: var(--border);
  stroke-width: 1;
}

.goals-collapse > summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
}

.ok-banner {
  color: var(--ok, #7dcea0);
  font-weight: 600;
  padding: 0.5rem 0;
}

.warn-banner {
  color: var(--warn, #e6b35a);
  font-weight: 600;
  padding: 0.5rem 0;
}

.e2e-key-banner {
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border, #333);
}

.e2e-key-banner.ok-banner {
  border-color: #3d6b4f;
  background: rgba(125, 206, 160, 0.08);
}

.e2e-device-panel {
  margin: 0.5rem 0.75rem;
}

.e2e-device-panel .e2e-key-banner {
  margin: 0;
}

.llm-advanced > summary {
  cursor: pointer;
  font-weight: 600;
}

a.primary-btn.kofi-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  text-align: center;
  box-sizing: border-box;
}

.settings-page {
  padding-bottom: 5.5rem;
}

.settings-locked {
  opacity: 0.92;
  position: relative;
}

.settings-locked::after {
  content: "Needs keyholder approval — use Submit below";
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

.settings-save-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom));
  margin-top: 1rem;
  background: linear-gradient(180deg, transparent, var(--bg, #121212) 28%);
  border-top: 1px solid var(--border, #333);
}

.settings-save-bar.hidden {
  display: none;
}

.settings-save-bar .settings-save-btn {
  width: 100%;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 1rem;
}

.modal-card {
  width: min(420px, 100%);
  max-height: 90vh;
  overflow: auto;
}

.chat-hamburger {
  font-size: 1.25rem;
  line-height: 1;
  min-width: 2.25rem;
}

button.chat-system-event,
.chat-system-clickable {
  display: block;
  width: auto;
  max-width: min(88%, 100%);
  margin: 0.15rem 0 0.15rem auto;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

button.chat-system-event:hover {
  border-style: solid;
  color: var(--text);
}

details.partner-orgasm-panel > summary {
  color: var(--text);
  font-weight: 600;
  font-size: 1rem;
}

.partner-context-radio {
  gap: 0.75rem;
}

details {
  margin-top: 0.5rem;
}

details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 0.9rem;
}

details[open] summary {
  margin-bottom: 0.75rem;
}

.bottom-bar {
  position: sticky;
  bottom: 0;
  background: rgba(26, 26, 26, 0.96);
  border-top: 1px solid var(--border);
  padding: 1rem 0 0;
  margin-top: 1rem;
}

.chastity-calendar-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.chastity-day-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 0.35rem;
}

.chastity-day-cell {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
}

.chastity-day-cell.full {
  background: var(--accent);
  color: var(--bg);
}

.chastity-day-cell.partial {
  border: 2px solid var(--text);
  color: var(--text);
}

.chastity-day-cell.none {
  background: var(--border);
  color: var(--muted);
  opacity: 0.55;
}

.chastity-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 2.15rem;
  gap: 0.12rem;
}

.sleep-ring {
  position: relative;
  width: 2.05rem;
  height: 2.05rem;
  display: grid;
  place-items: center;
}

.sleep-ring svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.sleep-ring .chastity-day-cell {
  width: 1.32rem;
  height: 1.32rem;
  font-size: 0.62rem;
  position: relative;
  z-index: 1;
}

.sleep-ring-track {
  fill: none;
  stroke: var(--border);
  stroke-width: 2.6;
}

.sleep-ring-value {
  fill: none;
  stroke-width: 2.8;
  stroke-linecap: butt;
}

.sleep-ring.sleep-red .sleep-ring-value { stroke: #dc4a4a; }
.sleep-ring.sleep-yellow .sleep-ring-value { stroke: #d4a017; }
.sleep-ring.sleep-green .sleep-ring-value { stroke: #2f9e5f; }

.chastity-sex-dots {
  display: flex;
  justify-content: center;
  gap: 0.14rem;
  min-height: 0.38rem;
}

.chastity-sex-dot {
  width: 0.32rem;
  height: 0.32rem;
  border-radius: 50%;
}

.chastity-sex-dot.denied { background: #dc4a4a; }
.chastity-sex-dot.ruined { background: #3b82f6; }
.chastity-sex-dot.full { background: #22c55e; }

.sleep-log-list {
  gap: 0.45rem;
}

.sleep-log-card.log-card-collapsed {
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
}

.stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.stats-table td {
  padding: 0.45rem 0.25rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.stats-table td:first-child {
  color: var(--muted);
  width: 55%;
}

@media (min-width: 720px) {
  .view {
    padding: 1.5rem 2rem 2.5rem;
  }
}

.playtime-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.playtime-option {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  text-align: left;
  border-radius: 14px;
  padding: 0.9rem 1rem;
}

.playtime-option.active {
  outline: 2px solid var(--accent);
}

.playtime-scene-body {
  white-space: pre-wrap;
  line-height: 1.45;
}

.playtime-ratings .choice-btn {
  min-width: 3rem;
}

.spin-options {
  gap: 0.75rem;
}

.spin-option-card .checkbox-label {
  font-weight: 600;
}

.spin-option-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.spin-option-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg-elevated);
  border-radius: 12px;
}

.spin-option-main {
  flex: 1;
  margin: 0;
}

.spin-expand-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0.25rem 0.4rem;
}

.spin-option-detail {
  padding: 0.35rem 0.85rem 0.75rem 2.1rem;
  font-size: 0.9rem;
}

.due-in-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.inbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: rgba(8, 8, 10, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.inbox-panel {
  width: min(26rem, 100%);
  max-height: min(78vh, 34rem);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.1rem 1.15rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(18, 18, 22, 0.62);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  color: #f2f2f2;
}

.inbox-panel h2 {
  margin: 0;
  font-size: 1.25rem;
}

.inbox-log {
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 0;
  flex: 1;
}

.inbox-log-item {
  text-align: left;
  width: 100%;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: inherit;
  cursor: pointer;
}

.inbox-log-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.inbox-log-item.task_overdue {
  border-color: rgba(220, 120, 90, 0.45);
}

.inbox-log-item.task_due_soon {
  border-color: rgba(210, 180, 90, 0.4);
}

.inbox-log-item.punishment_pending {
  cursor: pointer;
  border-color: rgba(192, 132, 252, 0.45);
}

.inbox-log-hit {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.punishment-remind-overlay {
  z-index: 90;
}

.punishment-remind-actions {
  margin-top: 0.5rem;
  gap: 0.45rem;
}

.inbox-log-title {
  font-weight: 600;
  margin-bottom: 0.15rem;
}

.inbox-log-body {
  font-size: 0.9rem;
  opacity: 0.9;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.inbox-log-when {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  opacity: 0.65;
}

.chastity-timeline-periods {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.chastity-timeline-period {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem 0.65rem 0.65rem;
  background: color-mix(in srgb, var(--bg-elevated, #222) 55%, transparent);
}

.chastity-timeline-period-summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  padding: 0.35rem 0;
}

.chastity-timeline-period-summary::-webkit-details-marker {
  display: none;
}

.chastity-timeline-period-range {
  font-size: 1.02rem;
}

.chastity-timeline-period-days {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
  white-space: nowrap;
}

.chastity-timeline-card h2 {
  margin: 0;
}

.chastity-timeline-list {
  position: relative;
  margin: 0.35rem 0 0;
  padding-left: 0.35rem;
}

.chastity-timeline-list::before {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 2px;
  background: rgba(255, 255, 255, 0.14);
}

.chastity-timeline-item {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.65rem;
  align-items: start;
  margin: 0.55rem 0;
  position: relative;
}

.chastity-timeline-dot {
  width: 0.85rem;
  height: 0.85rem;
  margin-top: 0.35rem;
  border-radius: 50%;
  border: 2px solid #1a1a1a;
  padding: 0;
  cursor: pointer;
  z-index: 1;
}

.chastity-timeline-dot.kind-lockup {
  background: #e08a3c;
}
.chastity-timeline-dot.kind-temp_unlock {
  background: #5b9fd4;
}
.chastity-timeline-dot.kind-release {
  background: #6fbf7a;
}
.chastity-timeline-dot.kind-unlocked {
  background: #8a9099;
}
.chastity-timeline-dot.kind-relock {
  background: #c9a227;
}
.chastity-timeline-dot.kind-eventual_release {
  background: transparent;
  border-color: #9aa3ad;
  border-style: dashed;
}
.chastity-timeline-item.kind-eventual_release .chastity-timeline-sub {
  font-weight: 600;
  letter-spacing: 0.02em;
}

.chastity-edit-notes summary {
  cursor: pointer;
  color: var(--muted, #6b7280);
  font-size: 0.95rem;
}

.chastity-timeline-edit-actions {
  gap: 0.75rem;
  flex-wrap: wrap;
}

.danger-btn {
  color: #9b2c2c;
}

.chastity-timer-overdue {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}

.chastity-timer-overdue-note {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  opacity: 0.85;
}

.chastity-timeline-title-btn {
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  font-weight: 600;
  font-size: 1.05rem;
  padding: 0;
  text-align: left;
  cursor: pointer;
  flex: 1;
}

.chastity-timeline-header {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chastity-timeline-edit-btn {
  flex: 0 0 auto;
  width: 1.55rem;
  height: 1.55rem;
  padding: 0;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(230, 230, 230, 0.85);
  font-size: 0.85rem;
  line-height: 1;
  cursor: pointer;
}

.chastity-timeline-edit-btn:hover {
  background: rgba(255, 255, 255, 0.12);
}

.chastity-timeline-edit h3 {
  margin: 0;
  font-size: 1.05rem;
}

.chastity-timeline-edit-host:empty {
  display: none;
}

.chastity-timeline-sub {
  margin: 0.15rem 0 0;
}

.chastity-timeline-when {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
}

.chastity-timeline-detail {
  margin-top: 0.45rem;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.chastity-timeline-gap {
  margin: 0.15rem 0 0.15rem 1.9rem;
  font-size: 0.88rem;
  font-style: italic;
  color: rgba(200, 200, 200, 0.72);
}

.tracking-cal-filters .row {
  margin-top: 0.35rem;
}

.tracking-cal-grid {
  display: grid;
  gap: 0.35rem;
}

.tracking-cal-grid.range-month {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tracking-cal-grid.range-7d {
  grid-template-columns: repeat(7, minmax(0, 1fr));
}

.tracking-cal-cell {
  min-height: 3.4rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: inherit;
  padding: 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  cursor: pointer;
}

.tracking-cal-cell.empty {
  border: none;
  background: transparent;
  pointer-events: none;
}

.tracking-cal-cell.has-events {
  background: rgba(255, 255, 255, 0.06);
}

.tracking-cal-daynum {
  font-size: 0.8rem;
  opacity: 0.85;
}

.tracking-cal-weekday {
  font-size: 0.68rem;
  opacity: 0.6;
}

.tracking-cal-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 0.18rem;
  align-items: center;
}

.tracking-cal-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  border: none;
  padding: 0;
  cursor: pointer;
}

.tracking-cal-dot.group-chastity,
.tracking-cal-dot.kind-chastity_lockup {
  background: #e08a3c;
}
.tracking-cal-dot.kind-chastity_temp_unlock,
.tracking-cal-dot.kind-chastity_relock {
  background: #5b9fd4;
}
.tracking-cal-dot.kind-chastity_release {
  background: #6fbf7a;
}
.tracking-cal-dot.group-orgasms,
.tracking-cal-dot.kind-orgasm,
.tracking-cal-dot.kind-play {
  background: #d45b8c;
}
.tracking-cal-dot.group-feelings,
.tracking-cal-dot.kind-feelings {
  background: #9b7bde;
}

.tracking-cal-overflow {
  font-size: 0.65rem;
  opacity: 0.7;
}

.tracking-cal-event-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: inherit;
  padding: 0.55rem 0.65rem;
  cursor: pointer;
}

@media (max-width: 520px) {
  .tracking-cal-grid.range-7d {
    grid-template-columns: 1fr;
  }
  .tracking-cal-cell {
    min-height: 2.6rem;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

/* --- Hub header (Tracking / Playtime) --- */
.hub-header {
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
}

.hub-header-copy {
  gap: 0.25rem;
}

.hub-features-btn {
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: 999px;
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
}

.app-features-backdrop .app-features-panel {
  width: min(420px, 100%);
  max-height: min(88vh, 720px);
  overflow: auto;
}

.hub-setup-details {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  background: var(--bg-card);
}

.hub-setup-details summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--text);
  list-style: none;
}

.hub-setup-details summary::-webkit-details-marker {
  display: none;
}

.hub-setup-details summary::before {
  content: "▸ ";
  color: var(--muted);
}

.hub-setup-details[open] summary::before {
  content: "▾ ";
}

.hub-setup-details .facet-list {
  margin-top: 0.75rem;
}

/* --- AI context flags menu (journal / scene builder) --- */
.context-flags-menu {
  border: 1px solid var(--border);
}

/* --- Log cards (tracking entries) --- */
.log-card {
  position: relative;
  padding-left: 1.15rem;
  gap: 0.5rem;
  display: flex;
  flex-direction: column;
}

.log-card-accent::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 4px;
  border-radius: 999px;
  background: var(--log-card-accent, var(--accent));
}

.log-card-top {
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

.log-card-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: transparent;
  border: none;
  color: inherit;
  text-align: left;
  padding: 0;
  cursor: pointer;
  min-width: 0;
}

.log-card-main {
  gap: 0.15rem;
  min-width: 0;
}

.log-card-main strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.log-card-when {
  font-size: 0.82rem;
}

.log-card-lockup {
  align-self: flex-start;
}

.log-card-chips {
  margin-top: 0.1rem;
}

.log-card-collapsed .log-card-chips {
  max-height: 2.4rem;
  overflow: hidden;
}

.tag-chip.secondary {
  opacity: 0.65;
  font-size: 0.76rem;
}

.log-card-details {
  border-top: 1px solid var(--border);
  padding-top: 0.6rem;
  margin-top: 0.1rem;
}

.log-card-orgasm + .log-card-orgasm,
.log-card-details .log-card-orgasm {
  margin-top: 0.55rem;
}

/* --- Kebab menu --- */
.kebab-menu-wrap {
  position: relative;
  flex-shrink: 0;
}

.kebab-menu-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
  cursor: pointer;
  border-radius: 8px;
}

.kebab-menu-btn:hover {
  background: rgba(255, 255, 255, 0.06);
}

.kebab-menu {
  position: absolute;
  right: 0;
  top: 2rem;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 8rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.kebab-menu-item {
  background: transparent;
  border: none;
  color: var(--text);
  text-align: left;
  padding: 0.6rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
}

.kebab-menu-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.kebab-menu-item.danger {
  color: var(--danger);
}

/* --- In-app camera --- */
.push-setup-guide ol.push-setup-list {
  margin: 0.25rem 0 0.75rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.push-setup-guide li {
  line-height: 1.35;
}

.in-app-camera-modal {
  z-index: 120;
}

.in-app-camera-card {
  width: min(480px, 100%);
  align-items: center;
}

.camera-toolbar {
  width: 100%;
  justify-content: center;
}
.camera-select {
  min-width: 9rem;
  max-width: 100%;
}
.torch-slider {
  flex: 1;
  min-width: 8rem;
}
.perm-row {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}
.perm-howto {
  font-size: 0.9rem;
}
.perm-howto-list {
  margin: 0.4rem 0 0 1.1rem;
  padding: 0;
}
.perm-state {
  margin-left: auto;
  font-size: 0.85rem;
}
.perm-state.perm-granted { color: var(--accent); }
.perm-state.perm-denied { color: #f87171; }

/* --- Toast --- */
.ubetra-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translate(-50%, 0.5rem);
  background: var(--bg-elevated);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.7rem 1.25rem;
  box-shadow: var(--shadow);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 200;
  max-width: min(90vw, 26rem);
  text-align: center;
}

.ubetra-toast.visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.manga-frame {
  padding: 1rem;
  border: 1px dashed var(--border);
  border-radius: 8px;
  min-height: 4rem;
}

.manga-panel {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}


.ai-config-badge {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 1.5px solid #c44;
  background: rgba(180, 40, 40, 0.15);
  color: #e66;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.ai-config-badge.hidden { display: none; }
.ai-tool-label.unmet { color: #e05555; }
.ai-recommend-box {
  padding: 0.75rem;
  border: 1px solid rgba(224, 85, 85, 0.35);
  border-radius: 8px;
  background: rgba(180, 40, 40, 0.08);
}
.ai-cap {
  font-size: 0.8rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.ai-cap.ok { color: #6fbf7a; border-color: rgba(111, 191, 122, 0.45); }
.ai-cap.fail { color: #e06666; border-color: rgba(224, 102, 102, 0.45); }
.ai-cap.unknown { color: #c9a227; border-color: rgba(201, 162, 39, 0.45); }
.ai-conn-row {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.cycle-flow-dot {
  display: inline-block;
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
  background: var(--border);
}
.cycle-flow-dot.spotting { background: #e8a0b0; }
.cycle-flow-dot.light { background: #e07090; }
.cycle-flow-dot.medium { background: #c43d62; }
.cycle-flow-dot.heavy { background: #8b1e3f; }
.cycle-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

/* --- Video call --- */
.video-call-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: #0b0b0d;
  display: flex;
  flex-direction: column;
  color: #fff;
}

.video-call-overlay.video-call-pip {
  background: transparent;
  pointer-events: none;
}

.video-call-overlay.video-call-pip .video-call-stage {
  position: absolute;
  right: 0.6rem;
  bottom: 7.2rem;
  width: min(11rem, 42vw);
  height: 10rem;
  flex: none;
  pointer-events: auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45);
}

.video-call-overlay.video-call-pip .video-call-dom-controls {
  display: none;
}

.video-call-overlay.video-call-pip .video-call-chat-log,
.video-call-overlay.video-call-pip .video-call-bar,
.video-call-overlay.video-call-pip .video-call-chat {
  pointer-events: auto;
  background: rgba(12, 12, 14, 0.94);
}

.video-call-stage {
  position: relative;
  flex: 1;
  min-height: 12rem;
  background: #111;
}

.video-call-remote {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}

.video-call-local {
  position: absolute;
  right: 0.7rem;
  bottom: 0.7rem;
  width: 28%;
  max-width: 9rem;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: #222;
  z-index: 2;
  touch-action: none;
  cursor: grab;
}

.video-call-local.dragging {
  cursor: grabbing;
}

.video-censor-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  object-fit: contain;
}

.video-call-bar .ghost-btn.active {
  border-color: var(--accent, #7eb6d9);
}

.video-call-status {
  position: absolute;
  left: 0.8rem;
  top: calc(0.6rem + env(safe-area-inset-top, 0px));
  margin: 0;
  z-index: 3;
  font-size: 0.85rem;
  text-shadow: 0 1px 4px #000;
}

.video-red-cover {
  position: absolute;
  inset: 0;
  z-index: 4;
  background: #c4122f;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.video-red-cover.hidden {
  display: none;
}

.video-call-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem;
  background: rgba(18, 18, 20, 0.96);
  border-top: 1px solid var(--border);
}

.video-hang-btn {
  margin-left: auto;
}

.video-call-dom-controls {
  padding: 0.55rem 0.7rem 0.2rem;
  background: rgba(18, 18, 20, 0.96);
  border-top: 1px solid var(--border);
  max-height: 40vh;
  overflow: auto;
}

.video-call-dom-controls .ghost-btn.active {
  border-color: var(--accent);
  color: var(--accent);
}

.video-call-chat-log {
  max-height: 6.5rem;
  overflow: auto;
  padding: 0.35rem 0.8rem;
  background: rgba(12, 12, 14, 0.9);
  font-size: 0.82rem;
}

.video-call-chat-line {
  margin: 0.15rem 0;
}

.video-call-chat {
  display: flex;
  gap: 0.4rem;
  padding: 0.45rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  background: rgba(18, 18, 20, 0.96);
}

.video-call-chat-input {
  flex: 1;
  min-width: 0;
}

.video-incoming {
  position: fixed;
  inset: 0;
  z-index: 115;
  background: rgba(0, 0, 0, 0.62);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.video-incoming-card {
  width: min(22rem, 100%);
  text-align: center;
}

.vault-image[controls] {
  max-height: 280px;
  object-fit: contain;
  background: #000;
}

.regimen-log {
  max-height: min(40vh, 22rem);
  min-height: 0;
}

.regimen-history {
  margin-top: 0.25rem;
}

.regimen-history .regimen-log {
  margin-top: 0.75rem;
  max-height: min(36vh, 18rem);
}

.regimen-tag-note {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
}

.regimen-tag-note p {
  margin: 0;
}

.regimen-suggest-row {
  align-items: flex-start;
}

.regimen-task-pick {
  align-items: flex-start;
  gap: 0.55rem;
}

.regimen-assigned {
  opacity: 0.72;
}

.regimen-tags-menu {
  margin: 0.15rem 0;
}

.regimen-idea {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.45rem 0.6rem;
}

.regimen-idea-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.5rem;
}

.regimen-idea-row > input[type="checkbox"] {
  flex: 0 0 1.15rem;
  width: 1.15rem;
  height: 1.15rem;
  min-width: 1.15rem;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  align-self: center;
}

.regimen-idea-toggle {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.4rem;
  margin: 0;
  padding: 0.1rem 0;
  text-align: left;
  background: none;
  border: none;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.regimen-idea-chevron {
  flex: 0 0 auto;
  color: var(--muted);
  line-height: 1.35;
}

.regimen-idea-title {
  flex: 0 1 auto;
  min-width: 0;
  font-weight: 600;
  line-height: 1.35;
  text-align: left;
  overflow-wrap: anywhere;
}

.regimen-idea-body {
  display: none;
  margin-top: 0.55rem;
}

.regimen-idea.open .regimen-idea-body {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.instructor-overlay {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  background: #000;
  color: #fff;
  font-family: Roboto, "Segoe UI", sans-serif;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: calc(2.2rem + env(safe-area-inset-bottom, 0px));
}
.instructor-sidebar {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  bottom: calc(2.2rem + env(safe-area-inset-bottom, 0px));
  z-index: 8;
  width: min(20.5rem, 88vw);
  max-width: 22rem;
  display: flex;
  flex-direction: column;
  background: rgba(0, 0, 0, 0.86);
  overflow: auto;
  pointer-events: auto;
}
.instructor-overlay.is-dom.is-sidebar-collapsed .instructor-sidebar {
  width: auto;
  max-width: none;
  background: rgba(0, 0, 0, 0.72);
  bottom: auto;
}
.instructor-overlay.is-dom.is-sidebar-collapsed .instructor-status-body {
  display: none;
}
.instructor-split {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
.instructor-cam-pane {
  flex: 1 1 46%;
  min-height: 0;
  background: #111;
  position: relative;
}
.instructor-cam-pane.hidden {
  display: none;
}
.instructor-cam-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #000;
}
.instructor-cam-label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.45rem;
  color: #fff;
  font-size: 0.85rem;
}
.instructor-cam-label.hidden {
  display: none;
}
.instructor-cam-select {
  width: 100%;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 0.45rem 0.4rem;
  font-size: 0.95rem;
}
.instructor-hud-top {
  position: absolute;
  top: env(safe-area-inset-top, 0px);
  left: 0;
  right: 0;
  z-index: 6;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  pointer-events: none;
}
.instructor-sidebar,
.instructor-hud-left,
.instructor-nav,
.instructor-status,
.instructor-persistent,
.instructor-triggers,
.instructor-icon-btn,
.instructor-nav-btn,
.instructor-exit-btn,
.instructor-zoom-btn {
  pointer-events: auto;
}
.instructor-hud-left {
  max-width: min(22rem, 92vw);
  padding: 0.35rem;
}
.instructor-overlay.is-dom .instructor-hud-left {
  max-width: min(28rem, 94vw);
}
.instructor-overlay.is-dom .instructor-status {
  background: transparent;
  padding: 0.45rem 0.55rem;
}
.instructor-overlay.is-dom .instructor-nav {
  flex-wrap: wrap;
  padding: 0.35rem 0 0.6rem;
}
.instructor-overlay.is-dom .instructor-beat-ctl {
  justify-content: flex-start;
  padding: 0.35rem 0 0.55rem;
  background: transparent;
}
.instructor-status {
  padding: 0.4rem;
  background: rgba(0, 0, 0, 0.62);
}
.instructor-brand {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  background: transparent;
  color: #fff;
  border: 0;
  text-transform: none;
  font-size: 0.95rem;
}
.instructor-brand-mark {
  color: #e91e63;
}
.instructor-caret {
  margin-left: auto;
}
.instructor-status-body {
  padding: 0.2rem 0.35rem 0.5rem;
}
.instructor-stat-line {
  display: flex;
  gap: 0.55rem;
  font-size: 0.82rem;
}
.instructor-stat-key,
.instructor-stat-val {
  color: #e91e63;
}
.instructor-stat-val {
  font-weight: 500;
}
.instructor-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.6rem;
  margin-top: 0.35rem;
}
.instructor-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #fff;
  font-size: 0.82rem;
  position: relative;
}
.instructor-switch-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}
.instructor-switch-track {
  width: 2.1rem;
  height: 1.05rem;
  border-radius: 1rem;
  background: #555;
  display: inline-flex;
  align-items: center;
  padding: 0.08rem;
}
.instructor-switch-thumb {
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  background: #fff;
  display: block;
  transition: transform 0.15s ease;
}
.instructor-switch-input:checked ~ .instructor-switch-track {
  background: #e91e63;
}
.instructor-switch-input:checked ~ .instructor-switch-track .instructor-switch-thumb {
  transform: translateX(1rem);
}
.instructor-persistent {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.45rem 0.2rem;
}
.instructor-cmd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}
.instructor-cmd-in {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
  font-size: 0.85rem;
}
.instructor-cmd-sec {
  width: 3.4rem;
  background: #1a1a1a;
  color: #fff;
  border: 1px solid #555;
  border-radius: 4px;
  padding: 0.35rem 0.3rem;
  font-size: 0.95rem;
}
.instructor-ruin,
.instructor-edge,
.instructor-go {
  border: 0;
  min-width: 5.5rem;
  padding: 0.55rem 0.9rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  opacity: 0.92;
}
.instructor-ruin {
  background: #3f51b5;
  color: #fff;
}
.instructor-edge {
  background: #d8d8d8;
  color: #111;
}
.instructor-hotkey {
  font-size: 0.7rem;
  font-weight: 500;
  margin-left: 0.25rem;
  opacity: 0.8;
}
.instructor-nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.35rem 0.4rem;
  color: #fff;
}
.instructor-icon-btn {
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 1.2rem;
  padding: 0.35rem 0.4rem;
}
.instructor-icon-btn.on {
  color: #e91e63;
}
.instructor-nav-btn,
.instructor-exit-btn,
.instructor-zoom-btn {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  min-width: 3.1rem;
  min-height: 2.6rem;
  padding: 0.45rem 0.7rem;
  font-size: 1.35rem;
  line-height: 1;
}
.instructor-exit-btn,
.instructor-zoom-btn {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-width: 4.6rem;
}
.instructor-chrome {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.55rem 0.7rem;
  background: rgba(0,0,0,0.72);
}
.instructor-timer, .instructor-bpm {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
}
.instructor-stage-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  background: #000;
}
.instructor-overlay.is-dom.has-cam:not(.is-zoom) .instructor-cam-pane {
  flex: 1 1 48%;
}
.instructor-overlay.is-dom.is-zoom .instructor-cam-pane {
  flex: 0 0 28%;
}
.instructor-overlay.is-dom .instructor-stage-wrap {
  flex: 1;
  max-height: none;
}
.instructor-stage {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #000;
}
.instructor-media {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.instructor-instruction {
  position: relative;
  margin: 0;
  padding: 0.7rem 1rem 0.85rem;
  font-size: 1.2rem;
  font-weight: 700;
  text-align: center;
  background: linear-gradient(transparent, rgba(0,0,0,0.88));
}
.instructor-instruction-text {
  display: block;
}
.instructor-progress-bar {
  position: absolute;
  left: 10%;
  right: 10%;
  bottom: 2.4rem;
  height: 0.22rem;
  width: 0;
  background: #e91e63;
}
.instructor-triggers {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(2.7rem + env(safe-area-inset-bottom, 0px));
  z-index: 9;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  padding: 0 0.8rem;
  pointer-events: auto;
}
.instructor-go {
  background: #e91e63;
  color: #fff;
  min-width: 9rem;
  min-height: 3.1rem;
  font-size: 0.95rem;
}
.instructor-go-alt {
  background: #ad1457;
}
.instructor-beat-lane {
  position: absolute;
  left: 0;
  right: 0;
  bottom: env(safe-area-inset-bottom, 0px);
  height: 2rem;
  margin: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 5;
  mask-image: linear-gradient(90deg, transparent, #000 22%, #000 100%);
}
.instructor-beat-lane.hidden {
  display: none;
}
.instructor-beat-lane-flow {
  position: absolute;
  inset: 0;
  display: block;
}
.instructor-beat-dot,
.instructor-beat-lane-flow span {
  position: absolute;
  top: 50%;
  left: 0;
  width: 0.62rem;
  height: 0.62rem;
  margin: 0;
  border-radius: 50%;
  background: #e91e63;
  opacity: 0.7;
  transform: translate3d(-999px, -50%, 0);
  will-change: transform, opacity;
}
.instructor-beat-hit {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 0.9rem;
  height: 0.9rem;
  margin: -0.45rem 0 0 -0.45rem;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #e91e63;
  z-index: 2;
  box-shadow: 0 0 10px rgba(233, 30, 99, 0.55);
}
.instructor-beat-lane.tick .instructor-beat-hit {
  animation: instructor-beat-pulse 0.18s ease-out;
}
@keyframes instructor-beat-flow {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-1 * (0.55rem + var(--beat-gap, 2.1rem)))); }
}
@keyframes instructor-beat-pulse {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(233, 30, 99, 0.75); }
  100% { transform: scale(1.75); box-shadow: 0 0 0 14px rgba(233, 30, 99, 0); }
}
.instructor-rec-badge {
  position: absolute;
  top: 0.45rem;
  right: 0.45rem;
  z-index: 3;
  background: #c62828;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
}
.instructor-rec-badge.hidden {
  display: none;
}
.instructor-sheet {
  position: absolute;
  left: 0.7rem;
  right: 0.7rem;
  bottom: calc(3.2rem + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1rem;
  background: #161616;
  border: 1px solid #444;
  border-radius: 10px;
  pointer-events: auto;
}
.instructor-sheet-title {
  margin: 0 0 0.2rem;
  font-weight: 700;
}
.instructor-sheet .primary-btn,
.instructor-sheet .ghost-btn,
.instructor-sheet .danger-btn {
  min-height: 3rem;
  width: 100%;
}
.instructor-sub-cam-ctl {
  margin-top: 0.4rem;
}
.instructor-overlay:not(.is-dom) .instructor-nav-btn,
.instructor-overlay:not(.is-dom) .instructor-exit-btn,
.instructor-overlay:not(.is-dom) .instructor-icon-btn {
  min-height: 2.9rem;
  min-width: 2.9rem;
}
.instructor-beat-ctl.hidden {
  display: none;
}
.instructor-beat-step {
  min-width: 2.6rem;
  min-height: 2.4rem;
  font-size: 1.4rem;
  font-weight: 700;
  background: #222;
  color: #fff;
  border: 1px solid #555;
}
.instructor-beat-slider {
  width: min(14rem, 42vw);
}
.instructor-beat-speed,
.instructor-beat-next {
  font-variant-numeric: tabular-nums;
  font-size: 0.92rem;
  color: #f8bbd0;
}
.instructor-pulse {
  display: none;
}
.instructor-done {
  position: absolute;
  left: 50%;
  bottom: 1.2rem;
  transform: translateX(-50%);
  min-width: 10rem;
}
.instructor-red-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #b10c1a;
  color: #fff;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.instructor-blocked {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.55);
  font-weight: 700;
}
.instructor-paused .instructor-media {
  filter: grayscale(1) brightness(0.45);
}
.instructor-empty {
  position: absolute;
  left: 1rem;
  right: 1rem;
  top: 40%;
  text-align: center;
}
.instructor-check {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.instructor-check input {
  width: auto;
}
.instructor-playlists {
  max-height: 12rem;
  overflow: auto;
}
.instructor-task-group {
  border: 1px solid var(--border, #444);
  padding: 0.6rem 0.7rem;
}
.instructor-task-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.2rem 0.6rem;
}
.instructor-dom-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.4rem;
}
.instructor-dom-btn {
  font-size: 0.75rem;
  padding: 0.2rem 0.45rem;
}
.instructor-overlay.is-dom .instructor-ruin,
.instructor-overlay.is-dom .instructor-edge,
.instructor-overlay.is-dom .instructor-go,
.instructor-overlay.is-dom .instructor-dom-btn {
  min-height: 2.9rem;
  min-width: 6.2rem;
  padding: 0.7rem 1.15rem;
  font-size: 1.05rem;
}
.instructor-overlay.is-dom .instructor-nav-btn,
.instructor-overlay.is-dom .instructor-exit-btn,
.instructor-overlay.is-dom .instructor-zoom-btn,
.instructor-overlay.is-dom .instructor-beat-step {
  min-height: 3rem;
  font-size: 1.15rem;
}
.instructor-overlay.is-dom .instructor-nav-btn {
  font-size: 1.55rem;
  min-width: 3.6rem;
}
.instructor-overlay.is-dom .instructor-switch {
  font-size: 0.95rem;
}
.instructor-overlay.is-dom .instructor-switch-track {
  width: 2.5rem;
  height: 1.25rem;
}
.instructor-overlay.is-dom .instructor-switch-thumb {
  width: 1.05rem;
  height: 1.05rem;
}
.instructor-overlay.is-dom .instructor-instruction {
  font-size: 1.35rem;
  padding: 0.85rem 1rem 0.9rem;
}

