/* lvling — styles (extracted from index.html) */
:root {
  color-scheme: dark;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  background: #06080d;
  color: #f4f7fb;
  /* System palette — used by the quest area (cyan chrome, violet RES). */
  --q-sys: #38bdf8;
  --q-res: #a78bfa;
  --q-line: #1b2940;
  --q-qink: #c8d4e6;
  --q-dim: #5d6b82;
  --q-pnl: #0d131f;
  --q-pnl2: #0a0f18;
  --q-clip: 11px;
  /* Reusable notched-corner clip-paths (sci-fi chamfer). */
  --notch-sm: polygon(
    5px 0,
    100% 0,
    100% calc(100% - 5px),
    calc(100% - 5px) 100%,
    0 100%,
    0 5px
  );
  --notch-md: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
  --notch-lg: polygon(
    11px 0,
    100% 0,
    100% calc(100% - 11px),
    calc(100% - 11px) 100%,
    0 100%,
    0 11px
  );
  --history-item-height: 2.8125rem;
  --feed-row-gap: 5px;
  --tab-feed-gap: 6px;
  --tab-feed-footer-height: 40px;
  --history-list-height: calc(
    var(--history-item-height) * 8 + var(--feed-row-gap) * 7
  );
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  display: grid;
  align-items: stretch;
  justify-items: center;
  padding: 0;
  background: #06080d;
}

main {
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  padding: 24px 12px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

.app-shell {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
}

p {
  margin: 0 0 24px;
  color: var(--q-qink);
  line-height: 1.5;
}

.providers {
  display: grid;
  gap: 12px;
}

.empty {
  margin-bottom: 0;
}

button {
  width: 100%;
  min-height: 52px;
  border: 0;
  clip-path: var(--notch-md);
  padding: 14px 16px;
  cursor: pointer;
  background: rgba(56, 189, 248, 0.14);
  color: var(--q-sys);
  font: inherit;
  font-weight: 800;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--q-sys);
  border-radius: 0;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  box-shadow: inset 0 0 22px -8px rgba(56, 189, 248, 0.9);
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease;
  clip-path: polygon(
    11px 0,
    100% 0,
    100% calc(100% - 11px),
    calc(100% - 11px) 100%,
    0 100%,
    0 11px
  );
}

.provider:hover {
  background: rgba(56, 189, 248, 0.2);
  box-shadow:
    inset 0 0 22px -6px rgba(56, 189, 248, 1),
    0 0 18px -6px rgba(56, 189, 248, 0.5);
}

.provider img {
  width: 22px;
  height: 22px;
}

.status {
  flex-shrink: 0;
  min-height: 24px;
  margin-top: 12px;
  color: var(--q-qink);
}

.app-shell > .status {
  padding-top: 12px;
  padding-right: 22px;
}

.character-area {
  flex-shrink: 0;
  margin-bottom: 8px;
}

.character-name {
  display: block;
  min-width: 0;
  margin-right: auto;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--q-dim);
}

.character-level-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 4px;
}

.character-level-frame {
  padding: 4px;
  clip-path: var(--notch-sm);
  background: color-mix(in srgb, var(--q-pnl2) 80%, #000);
  border: 1px solid color-mix(in srgb, var(--q-sys) 22%, transparent);
  box-shadow:
    inset 0 2px 5px rgba(0, 0, 0, 0.7),
    0 0 14px -8px var(--q-sys);
}

.character-level-bar {
  position: relative;
  width: 100%;
  height: 10px;
  border-radius: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.04) 0,
      rgba(255, 255, 255, 0.04) calc(10% - 2px),
      transparent calc(10% - 2px),
      transparent 10%
    ),
    rgba(0, 0, 0, 0.25);
  border: 0;
  overflow: hidden;
}

.character-level-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  border-radius: 0;
  background: var(--q-sys);
  box-shadow: 0 0 10px color-mix(in srgb, var(--q-sys) 60%, transparent);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.character-level-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    90deg,
    rgba(12, 15, 20, 0.25) 0,
    rgba(12, 15, 20, 0.25) 1px,
    transparent 1px
  );
  background-size: 10% 100%;
  background-repeat: repeat-x;
  pointer-events: none;
}

.character-level-inline {
  font-size: 1.3rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  color: #f4f7fb;
}

.character-level-pct {
  margin-left: auto;
  font-size: 1rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--q-qink);
}

.primary-cards {
  display: grid;
  flex-shrink: 0;
  grid-template-columns: 1fr;
  gap: 5px;
  margin-bottom: 12px;
}

.primary-cards-shared {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  min-width: 0;
}

.primary-card--compact .primary-card-name {
  font-size: 0.72rem;
}

.primary-card--compact .stat-changed-action-item {
  font-size: 0.55rem;
}

.primary-card--compact .stat-recent {
  gap: 4px;
}

.primary-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 5px 6px;
  border: 1px solid color-mix(in srgb, var(--q-sys) 16%, transparent);
  clip-path: var(--notch-md);
  background: color-mix(in srgb, var(--q-pnl) 80%, transparent);
  color: #f4f7fb;
}

.primary-card-name {
  font-size: 0.8rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.primary-card-track {
  width: 100%;
}

.stat-recent {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 2px;
}

.stat-changed-action-item {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
  font-size: 0.6rem;
  line-height: 1.2;
}

.stat-changed-action-item--latest {
  outline: 1px solid color-mix(in srgb, var(--q-sys) 55%, transparent);
  outline-offset: 1px;
  border-radius: 4px;
}

.stat-changed-amount {
  flex-shrink: 0;
  font-weight: 800;
  color: var(--q-qink);
  font-variant-numeric: tabular-nums;
}

.stat-changed-ago {
  flex-shrink: 0;
  font-weight: 600;
  color: var(--q-dim);
  font-variant-numeric: tabular-nums;
}

.stat-changed-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
  color: var(--q-qink);
}

.hud-bar-row--phy .stat-changed-amount {
  color: #ff6b6b;
}

.hud-bar-row--int .stat-changed-amount {
  color: #4da3ff;
}

.hud-bar-row--wrm .stat-changed-amount {
  color: #3fbf52;
}

.hud-bar-row--res .stat-changed-amount {
  color: #8b5cf6;
}

.hud-bar-row--dsc .stat-changed-amount {
  color: #f59e0b;
}

.hud-panel {
  display: grid;
  flex-shrink: 0;
  grid-template-columns: 1fr;
  gap: 8px 16px;
  align-items: start;
  margin-bottom: 16px;
}

.hud-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.hud-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.hud-section--spec {
  margin-top: 14px;
  gap: 3px;
}

.hud-col-label {
  margin: 0;
  font-size: 0.58rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--q-dim);
}

.hud-secondary-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hud-spec-row {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.hud-spec-head {
  flex-shrink: 0;
  width: 4.5rem;
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
}

.hud-bar-track.hud-spec-track {
  flex-shrink: 0;
  width: 48%;
  min-width: 0;
}

.hud-spec-row .stat-changed-action-item {
  overflow: hidden;
}

.hud-spec-row .stat-changed-action-item,
.hud-spec-empty {
  flex: 1 1 0;
  min-width: 0;
}

.hud-bar-row--spec .stat-changed-amount {
  color: var(--c, var(--q-ink));
}

.hud-bar-track {
  position: relative;
  width: 100%;
  min-width: 0;
  clip-path: polygon(
    4px 0,
    100% 0,
    100% calc(100% - 4px),
    calc(100% - 4px) 100%,
    0 100%,
    0 4px
  );
  background: color-mix(in srgb, var(--q-line) 60%, transparent);
  overflow: hidden;
}

.hud-bar-track--progress {
  height: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hud-bar-track--progress .hud-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
}

.hud-bar-fill {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: 0;
  transition: width 0.4s ease;
}

.hud-bar-track-label {
  position: relative;
  z-index: 1;
  font-size: 0.58rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: #f4f7fb;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.65);
  pointer-events: none;
  line-height: 1;
}

.hud-bar-row--phy .hud-bar-fill {
  background: #ff6b6b;
  opacity: 0.85;
}

.hud-bar-row--int .hud-bar-fill {
  background: #4da3ff;
  opacity: 0.85;
}

.hud-bar-row--wrm .hud-bar-fill {
  background: #3fbf52;
  opacity: 0.85;
}

.hud-bar-row--res .hud-bar-fill {
  background: #8b5cf6;
  opacity: 0.85;
}

.hud-bar-row--dsc .hud-bar-fill {
  background: #f59e0b;
  opacity: 0.85;
}

.hud-bar-row--spec .hud-bar-fill {
  background: var(--c, var(--q-sys));
  opacity: 0.85;
}

.hud-bar-row--swe .hud-bar-fill {
  background: #00ffff;
}

.hud-bar-row--swe .stat-changed-amount {
  color: #00ffff;
}

.hud-bar-row--gtr .hud-bar-fill {
  background: #ca6889;
}

.hud-bar-row--gtr .stat-changed-amount {
  color: #ca6889;
}

.stats-empty {
  margin: 0 0 20px;
  color: var(--q-dim);
}

.logout-btn {
  flex-shrink: 0;
  width: auto;
  min-height: 0;
  padding: 2px;
  clip-path: var(--notch-sm);
  background: transparent;
  color: var(--q-dim);
}

.logout-btn:hover,
.logout-btn:focus-visible {
  outline: none;
  color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 10%, transparent);
}

.logout-icon {
  display: block;
  width: 14px;
  height: 14px;
}

.middle-area {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  margin-bottom: 8px;
}
.quest-list-preview {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ===== System-themed quest card (notched, glowing panel) ===== */
.quest-card {
  position: relative;
  padding: 14px;
  background: color-mix(in srgb, var(--q-pnl) 86%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-sys) 18%, transparent);
  box-shadow:
    0 0 0 1px #000,
    0 14px 30px -22px #000;
  clip-path: polygon(
    var(--q-clip) 0,
    100% 0,
    100% calc(100% - var(--q-clip)),
    calc(100% - var(--q-clip)) 100%,
    0 100%,
    0 var(--q-clip)
  );
}

.quest-card-clickable {
  cursor: pointer;
}

.quest-card-clickable:hover,
.quest-card-clickable:focus-visible {
  outline: none;
  border-color: color-mix(in srgb, var(--q-sys) 38%, transparent);
  box-shadow:
    0 0 0 1px #000,
    0 14px 30px -22px #000,
    0 0 22px -10px var(--q-sys);
}

.quest-card--selected,
.quest-card--selected:hover {
  border-color: color-mix(in srgb, var(--q-sys) 55%, transparent);
  box-shadow:
    0 0 0 1px #000,
    0 0 26px -8px var(--q-sys);
}

.quest-card-top {
  display: flex;
  align-items: flex-start;
  gap: 13px;
}

.quest-card-main {
  flex: 1;
  min-width: 0;
}

.quest-card-title {
  font-family: "Chakra Petch", sans-serif;
  margin: 1px 0 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--q-qink);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quest-card-chips {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.quest-card-divider {
  height: 1px;
  background: var(--q-line);
  margin: 13px 0 10px;
}

.quest-card-meta {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--q-dim);
  letter-spacing: 0.02em;
}

.quest-card-desc {
  margin: 9px 0 0;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--q-dim);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* shared rank badge + chips + bounty (card and reading pane) */
.quest-rank {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: 21px;
  line-height: 1;
  color: var(--q-sys);
  border: 1px solid color-mix(in srgb, var(--q-sys) 45%, transparent);
  background: color-mix(in srgb, var(--q-sys) 9%, transparent);
  box-shadow:
    inset 0 0 12px -4px var(--q-sys),
    0 0 14px -6px var(--q-sys);
  clip-path: polygon(
    7px 0,
    100% 0,
    100% calc(100% - 7px),
    calc(100% - 7px) 100%,
    0 100%,
    0 7px
  );
  text-shadow: 0 0 10px color-mix(in srgb, var(--q-sys) 70%, transparent);
}

.quest-rank--sm {
  width: 34px;
  height: 34px;
  font-size: 17px;
}

.quest-chip {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 600;
  padding: 3px 8px;
  border: 1px solid var(--q-line);
  color: var(--q-dim);
}

.quest-chip--active {
  color: var(--q-sys);
  border-color: color-mix(in srgb, var(--q-sys) 40%, transparent);
  background: color-mix(in srgb, var(--q-sys) 8%, transparent);
}

.quest-bounty {
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  color: var(--q-res);
  white-space: nowrap;
  text-shadow: 0 0 12px color-mix(in srgb, var(--q-res) 55%, transparent);
}

.quest-lastlog {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-top: 11px;
}

.quest-lastlog-node {
  flex: none;
  width: 6px;
  height: 6px;
  margin-top: 5px;
  background: var(--q-sys);
  transform: rotate(45deg);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--q-sys) 70%, transparent);
}

.quest-lastlog-body {
  font-size: 12.5px;
  color: var(--q-qink);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.quest-lastlog-when {
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  color: var(--q-dim);
  margin-top: 4px;
  padding-left: 15px;
}
.quest-view-head .post-payout {
  flex-shrink: 0;
}
.quest-view-desc {
  margin: 12px 0 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--q-qink);
  white-space: pre-wrap;
}

.quest-view-time {
  margin-top: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--q-dim);
  text-align: right;
}

.quest-empty {
  margin: 0;
  font-size: 0.62rem;
  color: var(--q-dim);
  font-style: italic;
}

/* ===== System-themed reading pane (opened quest, shown as a modal) ===== */
.quest-detail {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(100%, 480px);
  max-height: calc(100dvh - 48px);
  min-height: 0;
  background: color-mix(in srgb, var(--q-pnl) 92%, #000);
  border: 1px solid color-mix(in srgb, var(--q-sys) 22%, transparent);
  box-shadow:
    0 0 0 1px #000,
    0 18px 40px -24px #000,
    0 0 26px -12px var(--q-sys);
  clip-path: polygon(
    var(--q-clip) 0,
    100% 0,
    100% calc(100% - var(--q-clip)),
    calc(100% - var(--q-clip)) 100%,
    0 100%,
    0 var(--q-clip)
  );
}

.quest-detail-scroll {
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.quest-detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: auto;
  min-height: 0;
  padding: 4px 8px;
}

.quest-detail .modal-actions {
  margin-top: 16px;
  gap: 8px;
}

/* Compact, System-styled action buttons inside the reading pane. */
.quest-detail .modal-btn {
  min-height: 0;
  padding: 8px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
}

.quest-loghead {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 4px;
  padding-right: 30px;
}

.quest-loghead-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: "Chakra Petch", sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--q-qink);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quest-log {
  margin-top: 18px;
}

.quest-log-label {
  margin: 18px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.26em;
  font-size: 10px;
  color: var(--q-dim);
}

/* capture: one line, append, done */
.quest-capture {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  margin-bottom: 18px;
  border: 1px solid var(--q-line);
  background: var(--q-pnl2);
  clip-path: polygon(
    8px 0,
    100% 0,
    100% calc(100% - 8px),
    calc(100% - 8px) 100%,
    0 100%,
    0 8px
  );
}

.quest-capture--disabled {
  opacity: 0.6;
}

.quest-capture-caret {
  color: var(--q-sys);
  font-weight: 600;
  font-family: "JetBrains Mono", monospace;
}

.quest-capture-input {
  flex: 1;
  min-width: 0;
  background: none;
  border: none;
  outline: none;
  color: var(--q-qink);
  font-family: "Chakra Petch", sans-serif;
  font-size: 16px;
}

.quest-capture-input::placeholder {
  color: var(--q-dim);
}

.quest-capture-hint {
  flex: none;
  width: auto;
  min-height: 0;
  padding: 2px 6px;
  border: 1px solid var(--q-line);
  background: none;
  color: var(--q-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  white-space: nowrap;
  cursor: pointer;
}

.quest-capture-hint:hover:not(:disabled),
.quest-capture-hint:focus-visible:not(:disabled) {
  outline: none;
  color: var(--q-sys);
  border-color: color-mix(in srgb, var(--q-sys) 45%, transparent);
}

.quest-capture-hint:disabled {
  opacity: 0.4;
  cursor: default;
}

/* the thread: a glowing spine with a node per entry */
.quest-thread {
  position: relative;
  padding-left: 22px;
}

.quest-thread::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  bottom: 6px;
  width: 1px;
  opacity: 0.5;
  background: linear-gradient(
    var(--q-sys),
    color-mix(in srgb, var(--q-sys) 10%, transparent)
  );
}

.quest-entry {
  position: relative;
  padding: 0 0 20px;
  cursor: pointer;
}

.quest-entry:last-child {
  padding-bottom: 2px;
}

.quest-entry-node {
  position: absolute;
  left: -19px;
  top: 5px;
  width: 7px;
  height: 7px;
  background: var(--q-pnl2);
  border: 1px solid color-mix(in srgb, var(--q-sys) 55%, transparent);
  transform: rotate(45deg);
}

.quest-entry--live .quest-entry-node {
  background: var(--q-sys);
  border-color: var(--q-sys);
  box-shadow: 0 0 9px 1px color-mix(in srgb, var(--q-sys) 75%, transparent);
}

.quest-entry-when {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--q-dim);
  text-transform: uppercase;
  margin-bottom: 3px;
}

.quest-entry-text {
  font-size: 14px;
  line-height: 1.45;
  color: var(--q-qink);
  white-space: pre-wrap;
  word-break: break-word;
}

/* The venture trickle: a plain note carries no chrome (Option 2) — tap the entry
   to value it. A stamped step shows a small tier-colored chip by its timestamp;
   the easy/medium/hard picker appears inline only while that entry is open. */
.quest-entry-chip {
  flex: none;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: none;
  color: currentColor;
  background: color-mix(in srgb, currentColor 16%, transparent);
  border: 1px solid color-mix(in srgb, currentColor 55%, transparent);
  clip-path: var(--notch-sm);
}

/* Expanded state: a fill slider (0 · 1 · 3 · 6, evenly spaced) + the ✎ edit
   affordance / Delete↔Update mini-button. Fill length is the signal. */
.quest-entry-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 9px;
}

.step-slider {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  cursor: pointer;
}

.step-slider::before {
  content: "";
  position: absolute;
  left: 5px;
  right: 5px;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  background: color-mix(in srgb, var(--q-sys) 18%, transparent);
}

.step-slider-fill {
  position: absolute;
  left: 5px;
  top: 50%;
  height: 3px;
  transform: translateY(-50%);
  background: var(--q-res);
  box-shadow: 0 0 8px 0 color-mix(in srgb, var(--q-res) 55%, transparent);
  transition: width 0.12s ease;
}

.step-slider-stop {
  position: relative;
  z-index: 1;
  flex: none;
  box-sizing: border-box;
  width: 13px;
  height: 13px;
  min-height: 0; /* override the global button min-height: 52px */
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--q-sys) 45%, transparent);
  background: var(--q-pnl2);
  border-radius: 50%;
  clip-path: none; /* override the global notched clip so it stays a circle */
  cursor: pointer;
}

.step-slider-stop.is-on {
  border-color: var(--q-res);
}

.step-slider-stop.is-active {
  background: var(--q-res);
  border-color: var(--q-res);
  box-shadow: 0 0 8px 1px color-mix(in srgb, var(--q-res) 60%, transparent);
}

.quest-entry-edit {
  width: 100%;
  font-size: 14px;
  line-height: 1.45;
  color: var(--q-qink);
  background: color-mix(in srgb, var(--q-sys) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-sys) 30%, transparent);
  padding: 4px 8px;
  clip-path: var(--notch-sm);
}

/* Very modest inline controls — nowhere near full modal size. */
.quest-entry-editbtn,
.log-mini-btn {
  flex: none;
  width: auto; /* override global button width: 100% */
  min-height: 0; /* override global button min-height: 52px */
  padding: 2px 9px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  clip-path: var(--notch-sm);
  cursor: pointer;
}

.quest-entry-editbtn {
  color: var(--q-dim);
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--q-sys) 25%, transparent);
}

.log-mini-delete {
  color: #ff6b6b;
  background: color-mix(in srgb, #ff6b6b 12%, transparent);
  border: 1px solid color-mix(in srgb, #ff6b6b 50%, transparent);
}

.log-mini-update {
  color: #79f2b8;
  background: color-mix(in srgb, #79f2b8 12%, transparent);
  border: 1px solid color-mix(in srgb, #79f2b8 50%, transparent);
}

/* Duties: flat list + pick → dial → commit. Tapping a duty opens the dial; its
   three dots grow with intensity (minor/moderate/major) and tapping one commits
   the log. A brief "+N DSC" flash confirms. */
/* Universal payout flash — large, center-screen "+N STAT" on any XP gain. */
.payout-flash {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 26px;
  pointer-events: none;
  animation: payout-flash-pop 2.2s ease forwards;
}

.payout-flash-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

/* Scoped so the chip class supplies the stat color but not its background. */
.payout-flash .payout-flash-amt {
  font-family: "Chakra Petch", system-ui, sans-serif;
  font-size: clamp(3rem, 18vw, 6rem);
  font-weight: 900;
  line-height: 1;
  background: none;
  border: 0;
  padding: 0;
  clip-path: none;
  text-shadow: 0 0 24px color-mix(in srgb, currentColor 60%, transparent);
}

.payout-flash-key {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--q-dim);
}

@keyframes payout-flash-pop {
  0% {
    opacity: 0;
    transform: scale(0.7);
  }
  14% {
    opacity: 1;
    transform: scale(1.06);
  }
  28% {
    transform: scale(1);
  }
  68% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.12);
  }
}

/* Journal: a standalone view — write/edit today's entry {
  padding: 6px 2px 14px;
}
.journal-textarea {
  width: 100%;
  resize: vertical;
}
.journal-save {
  width: auto;
  min-width: 96px;
}
.journal-entry {
  padding: 10px 12px;
  background: color-mix(in srgb, var(--q-sys) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-sys) 14%, transparent);
  clip-path: var(--notch-sm);
}

.journal-entry-date {
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--q-dim);
  margin-bottom: 4px;
}

.journal-entry-text {
  font-size: 14px;
  line-height: 1.5;
  color: var(--q-qink);
  white-space: pre-wrap;
  word-break: break-word;
}

.journal-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.journal-filter {
  display: flex;
  gap: 6px;
  margin: 0 0 12px;
}
/* Intensity = a single significance axis (re-read lens) {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}
.intensity-stop.is-active.intensity-stop--0 {
  color: var(--q-qink);
  border-color: color-mix(in srgb, var(--q-dim) 70%, transparent);
  background: color-mix(in srgb, var(--q-dim) 22%, transparent);
}
.intensity-stop.is-active.intensity-stop--1 {
  color: var(--q-sys);
  border-color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 16%, transparent);
}
.intensity-stop.is-active.intensity-stop--2 {
  color: var(--q-sys);
  border-color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 28%, transparent);
  box-shadow: 0 0 10px 0 color-mix(in srgb, var(--q-sys) 45%, transparent);
}

/* The per-entry badge: shows the current level, tap to open the re-rate dial. */
.journal-intensity-badge {
  flex: none;
  width: auto;
  min-height: 0;
  padding: 1px 7px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--q-dim);
  background: color-mix(in srgb, var(--q-dim) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-dim) 38%, transparent);
  clip-path: var(--notch-sm);
  cursor: pointer;
}
.journal-intensity-badge.intensity-stop--1 {
  color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 14%, transparent);
  border-color: color-mix(in srgb, var(--q-sys) 45%, transparent);
}
.journal-intensity-badge.intensity-stop--2 {
  color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 26%, transparent);
  border-color: var(--q-sys);
  box-shadow: 0 0 8px 0 color-mix(in srgb, var(--q-sys) 40%, transparent);
}

/* HUD timer: focus start / live countdown + stop, in the character header. */
/* Timer lives inline in the character header row — invisible when idle, a
   compact chip (label · time · ◼) when a focus block is running. The *start*
   button lives in the Focus tab. */
.character-top-row {
  display: flex;
  align-items: center;
  gap: 8px;
  /* Reserve the focus-timer pill's fixed height (24px) so it appears/disappears
     without nudging the rest of the bar down. */
  height: 26px;
}

.hud-timer-inline {
  height: 24px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 5px 0 10px;
  border: 1px solid color-mix(in srgb, var(--q-sys) 30%, transparent);
  clip-path: var(--notch-sm);
}

.hud-timer-label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--q-dim);
}

.hud-timer-time {
  font-family: "JetBrains Mono", monospace;
  font-size: 13px;
  font-weight: 800;
  color: var(--q-sys);
  font-variant-numeric: tabular-nums;
}

.hud-timer-stop {
  width: auto;
  min-height: 0;
  padding: 2px 8px;
  font-size: 11px;
  color: #ff6b6b;
  background: color-mix(in srgb, #ff6b6b 12%, transparent);
  border: 1px solid color-mix(in srgb, #ff6b6b 45%, transparent);
  clip-path: var(--notch-sm);
}

/* Timer-bell modals — above everything. */
.timer-done-overlay {
  z-index: 2500;
}

.timer-done-sub {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--q-dim);
}

.timer-block-picker {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}
.focus-toggle.is-on {
  color: var(--q-sys);
  border-color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 14%, transparent);
}

.quest-log-empty {
  margin: 0;
  padding-left: 22px;
  font-size: 0.66rem;
  color: var(--q-dim);
  font-style: italic;
}

@media (prefers-reduced-motion: no-preference) {
  .quest-lastlog-node,
  .quest-entry--live .quest-entry-node {
    animation: quest-node-pulse 2.6s ease-in-out infinite;
  }

  @keyframes quest-node-pulse {
    0%,
    100% {
      box-shadow: 0 0 8px 1px
        color-mix(in srgb, var(--q-sys) 60%, transparent);
    }
    50% {
      box-shadow: 0 0 13px 3px
        color-mix(in srgb, var(--q-sys) 85%, transparent);
    }
  }
}

.quest-filter-row {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.quest-filter-btn {
  flex: 1;
  min-height: 36px;
  padding: 6px 8px;
  clip-path: var(--notch-sm);
  background: color-mix(in srgb, var(--q-pnl2) 70%, transparent);
  color: var(--q-dim);
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.quest-filter-btn:hover,
.quest-filter-btn:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--q-sys) 10%, transparent);
  color: var(--q-qink);
}

.quest-filter-btn--active {
  background: color-mix(in srgb, var(--q-sys) 18%, transparent);
  color: var(--q-sys);
  box-shadow:
    inset 0 0 14px -6px var(--q-sys),
    0 0 14px -4px color-mix(in srgb, var(--q-sys) 50%, transparent);
}


.new-quest-btn {
  width: 100%;
  min-height: 44px;
  margin-bottom: 12px;
  clip-path: var(--notch-md);
  background: color-mix(in srgb, var(--q-sys) 14%, transparent);
  color: var(--q-sys);
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  box-shadow: inset 0 0 18px -8px var(--q-sys);
}

.new-quest-btn:hover,
.new-quest-btn:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--q-sys) 22%, transparent);
  box-shadow:
    inset 0 0 18px -6px var(--q-sys),
    0 0 16px -6px color-mix(in srgb, var(--q-sys) 50%, transparent);
}
.tier-btn--s {
  color: #bf3dff;
}
.tier-btn--a {
  color: #a855f7;
}
.tier-btn--b {
  color: #9a64d4;
}
.tier-btn--c {
  color: #8a72ab;
}
.tier-btn--d {
  color: #7d7590;
}
/* Severity filter tabs use the plain (blue) .quest-filter-btn styling now;
   no amber. The severity word still distinguishes them. */

.severity-dial-value {
  min-width: 96px;
  text-align: center;
  font-size: 0.92rem;
  font-weight: 900;
  line-height: 1.1;
  text-transform: capitalize;
}
.status-toggle-row {
  display: flex;
  gap: 8px;
}

.status-toggle-btn {
  flex: 1;
  min-height: 40px;
  padding: 8px;
  clip-path: var(--notch-sm);
  background: color-mix(in srgb, var(--q-pnl2) 70%, transparent);
  color: var(--q-dim);
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.status-toggle-btn--active {
  background: color-mix(in srgb, var(--q-sys) 18%, transparent);
  color: var(--q-sys);
  box-shadow:
    inset 0 0 14px -6px var(--q-sys),
    0 0 12px -4px color-mix(in srgb, var(--q-sys) 50%, transparent);
}

.tab-bottom {
  flex-shrink: 0;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Bottom nav: a row of plain words, set apart from the paneled area above
   by a divider. No frames — shrinking the screen just closes the gaps. */
.launch-tabs {
  display: flex;
  flex-shrink: 0;
  flex-wrap: nowrap;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  padding: 9px 4px 0;
  border-top: 1px solid color-mix(in srgb, var(--q-line) 85%, transparent);
  background: transparent;
}

.launch-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  min-width: 0;
  min-height: 38px;
  padding: 6px 2px;
  clip-path: none;
  background: none;
  border: 0;
  box-shadow: none;
  color: var(--q-dim);
  font-family: "Chakra Petch", sans-serif;
  font-weight: 700;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  transition:
    color 0.15s ease,
    text-shadow 0.15s ease;
}

.launch-btn:hover,
.launch-btn:focus-visible {
  outline: none;
  color: var(--q-sys);
  text-shadow: 0 0 10px color-mix(in srgb, var(--q-sys) 55%, transparent);
}
.feed {
  display: grid;
  gap: var(--feed-row-gap);
  margin-bottom: 14px;
  transition: opacity 0.15s ease;
}
.tab-feed > .feed {
  margin-bottom: 0;
}
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(4, 6, 9, 0.7);
  backdrop-filter: blur(4px);
}

.modal {
  width: min(100%, 360px);
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--q-sys) 22%, transparent);
  clip-path: var(--notch-lg);
  background: color-mix(in srgb, var(--q-pnl) 92%, #000);
  box-shadow:
    0 0 0 1px #000,
    0 24px 80px rgba(0, 0, 0, 0.5),
    0 0 32px -14px var(--q-sys);
}
.modal-title {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.modal-title-edit {
  width: auto;
  min-height: 28px;
  padding: 4px 8px;
  clip-path: var(--notch-sm);
  background: color-mix(in srgb, var(--q-sys) 10%, transparent);
  color: var(--q-dim);
  font-size: 0.9rem;
  line-height: 1;
  flex-shrink: 0;
}

.modal-title-edit:hover,
.modal-title-edit:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--q-sys) 18%, transparent);
  color: var(--q-sys);
}
.modal-note-empty {
  flex: 1;
  margin: 0;
  color: var(--q-dim);
  font-size: 0.82rem;
  font-style: italic;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 22px;
}

/* System-themed action buttons — notched, translucent, accent glow. */
.modal-btn {
  flex: 1;
  min-height: 48px;
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-radius: 0;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease;
  clip-path: polygon(
    9px 0,
    100% 0,
    100% calc(100% - 9px),
    calc(100% - 9px) 100%,
    0 100%,
    0 9px
  );
}

.modal-cancel {
  background: rgba(255, 255, 255, 0.06);
  color: var(--q-qink);
}

.modal-cancel:hover {
  background: rgba(255, 255, 255, 0.12);
}

.modal-confirm {
  background: rgba(121, 242, 184, 0.16);
  color: #79f2b8;
  box-shadow: inset 0 0 18px -6px rgba(121, 242, 184, 0.9);
}

.modal-confirm:hover {
  background: rgba(121, 242, 184, 0.24);
  box-shadow:
    inset 0 0 18px -4px rgba(121, 242, 184, 1),
    0 0 16px -6px rgba(121, 242, 184, 0.6);
}

.modal-delete {
  background: rgba(255, 107, 107, 0.14);
  color: #ff8f8f;
  box-shadow: inset 0 0 18px -6px rgba(255, 107, 107, 0.9);
}

.modal-delete:hover {
  background: rgba(255, 107, 107, 0.22);
  box-shadow:
    inset 0 0 18px -4px rgba(255, 107, 107, 1),
    0 0 16px -6px rgba(255, 107, 107, 0.5);
}
.post {
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--q-sys) 16%, transparent);
  clip-path: var(--notch-md);
  background: color-mix(in srgb, var(--q-pnl) 80%, transparent);
}
.post-history .post-payout {
  flex-wrap: nowrap;
  gap: 3px;
  overflow: hidden;
  min-width: 0;
}

.post-history .payout-chip {
  padding: 1px 5px;
  font-size: 0.64rem;
  font-weight: 700;
  line-height: 1.2;
}
.post-payout {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 0;
}

.payout-chip {
  padding: 1px 7px;
  clip-path: polygon(
    4px 0,
    100% 0,
    100% calc(100% - 4px),
    calc(100% - 4px) 100%,
    0 100%,
    0 4px
  );
  background: rgba(121, 242, 184, 0.12);
  color: #79f2b8;
  font-size: 0.68rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1.35;
}

.post-payout--compact {
  gap: 3px;
}

.payout-chip--compact {
  padding: 0 5px;
  font-size: 0.6rem;
  line-height: 1.3;
}

.payout-chip--phy {
  background: rgba(255, 107, 107, 0.14);
  color: #ff6b6b;
}

.payout-chip--int {
  background: rgba(77, 163, 255, 0.14);
  color: #4da3ff;
}

.payout-chip--wrm {
  background: rgba(63, 191, 82, 0.14);
  color: #3fbf52;
}

.payout-chip--res {
  background: rgba(139, 92, 246, 0.16);
  color: #8b5cf6;
}

.payout-chip--dsc {
  background: rgba(245, 158, 11, 0.14);
  color: #f59e0b;
}

.payout-chip--swe {
  background: rgba(0, 255, 255, 0.12);
  color: #00ffff;
}

.payout-chip--gtr {
  background: rgba(202, 104, 137, 0.14);
  color: #ca6889;
}

.payout-chip-btn {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: background 0.15s ease;
}

.payout-chip-btn:hover,
.payout-chip-btn:focus-visible {
  outline: none;
  background: rgba(121, 242, 184, 0.22);
}

.payout-chip-btn.payout-chip--phy:hover,
.payout-chip-btn.payout-chip--phy:focus-visible {
  background: rgba(255, 107, 107, 0.26);
}

.payout-chip-btn.payout-chip--int:hover,
.payout-chip-btn.payout-chip--int:focus-visible {
  background: rgba(77, 163, 255, 0.26);
}

.payout-chip-btn.payout-chip--wrm:hover,
.payout-chip-btn.payout-chip--wrm:focus-visible {
  background: rgba(63, 191, 82, 0.26);
}

.payout-chip-btn.payout-chip--res:hover,
.payout-chip-btn.payout-chip--res:focus-visible {
  background: rgba(139, 92, 246, 0.28);
}

.payout-chip-btn.payout-chip--dsc:hover,
.payout-chip-btn.payout-chip--dsc:focus-visible {
  background: rgba(245, 158, 11, 0.26);
}

.payout-chip-btn.payout-chip--swe:hover,
.payout-chip-btn.payout-chip--swe:focus-visible {
  background: rgba(0, 255, 255, 0.24);
}
.payout-chip-add {
  width: auto;
  min-height: 24px;
  padding: 3px 10px;
  clip-path: var(--notch-sm);
  background: rgba(121, 242, 184, 0.12);
  color: #79f2b8;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1;
  box-shadow: inset 0 0 12px -6px rgba(121, 242, 184, 0.9);
}

.payout-chip-add:hover,
.payout-chip-add:focus-visible {
  outline: none;
  background: rgba(121, 242, 184, 0.2);
  box-shadow:
    inset 0 0 12px -4px rgba(121, 242, 184, 1),
    0 0 12px -5px rgba(121, 242, 184, 0.5);
}

.modal-overlay--nested {
  z-index: 60;
}

.modal--compact {
  width: min(92vw, 320px);
}
.modal-field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
}

.modal-field label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--q-dim);
}

.modal-input,
.modal-textarea {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--q-sys) 20%, transparent);
  clip-path: var(--notch-md);
  background-color: color-mix(in srgb, var(--q-pnl2) 80%, #000);
  color: #f4f7fb;
  font: inherit;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.modal-input:focus,
.modal-textarea:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--q-sys) 55%, transparent);
  box-shadow: inset 0 0 16px -8px var(--q-sys);
}

.modal-textarea {
  min-height: 72px;
  resize: vertical;
}
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 0;
}

.pager-btn {
  width: auto;
  min-height: 40px;
  padding: 8px 16px;
  clip-path: var(--notch-md);
  background: color-mix(in srgb, var(--q-pnl) 82%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-sys) 18%, transparent);
  color: var(--q-qink);
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pager-btn:hover:not(:disabled),
.pager-btn:focus-visible {
  outline: none;
  background: color-mix(in srgb, var(--q-sys) 12%, transparent);
  border-color: color-mix(in srgb, var(--q-sys) 40%, transparent);
  color: var(--q-sys);
}

.pager-btn:disabled {
  cursor: default;
  opacity: 0.4;
}

.pager-info {
  font-size: 0.78rem;
  color: var(--q-dim);
  font-variant-numeric: tabular-nums;
}
.error {
  color: #ff9b9b;
}

/* Tiny email/password sign-in on the login screen (dev / non-OAuth). */
.email-login {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.email-login-btn {
  align-self: flex-start;
  width: auto;
  min-height: 0;
  padding: 8px 16px;
  clip-path: var(--notch-sm);
  background: color-mix(in srgb, var(--q-sys) 14%, transparent);
  color: var(--q-sys);
  font-family: "Chakra Petch", sans-serif;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ===== Tab views (Phase 4): bottom nav switches the shared middle area ===== */
.tab-view {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tab-view--scroll {
  overflow-y: auto;
}

.launch-btn--active {
  color: var(--q-sys);
  text-shadow: 0 0 10px color-mix(in srgb, var(--q-sys) 55%, transparent);
}

/* ===== Focus / Gym / People pens + the unified Timeline ===== */
.focus-lead,
.people-lead {
  margin: 4px 0 14px;
  font-size: 13px;
  color: var(--q-dim);
}

.focus-sub {
  margin: 18px 0 8px;
  font-family: "JetBrains Mono", monospace;
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--q-dim);
}

/* Focus tab */
.focus-start {
  width: 100%;
  min-height: 0;
  padding: 16px;
  font-family: "JetBrains Mono", monospace;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 12%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-sys) 40%, transparent);
  clip-path: var(--notch-md);
}

.focus-start:disabled {
  opacity: 0.5;
}

.focus-blocks {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* People tab — depth tiles, congrats-not-ledger */
.people-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* The shared pen tile (lib.js PenButton) — one panel for every pay-action
   across Focus / Exercise / Duties / People. The tinted slab lives on .pen-btn;
   the head is a borderless click target; an optional body (logger, dial) sits
   below, inside the same border. --active suppresses the hover lift while open. */
.pen-btn {
  background: color-mix(in srgb, var(--q-sys) 5%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-sys) 20%, transparent);
  clip-path: var(--notch-md);
}
.pen-btn:not(.pen-btn--active):not(.pen-btn--selected):hover {
  border-color: color-mix(in srgb, var(--q-sys) 45%, transparent);
  background: color-mix(in srgb, var(--q-sys) 9%, transparent);
}
.pen-btn--selected {
  border-color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 16%, transparent);
}
.pen-btn--selected .pen-btn-name {
  color: var(--q-sys);
}

.pen-btn-head {
  width: 100%;
  min-height: 0;
  clip-path: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
  text-align: left;
  color: var(--q-ink);
  background: transparent;
  border: none;
  cursor: pointer;
}
.pen-btn-head--static {
  cursor: default;
}
.pen-btn-head:disabled {
  opacity: 0.6;
}

.pen-btn-headline {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.pen-btn-name {
  font-size: 15px;
  font-weight: 800;
}

.pen-btn-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--q-dim);
}

/* Gym tab */
.exercise-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.exercise-logger {
  display: flex;
  gap: 6px;
  padding: 0 10px 10px;
}

.exercise-input {
  width: 100%;
  min-width: 0;
  padding: 8px;
  font-size: 14px;
  text-align: center;
  color: var(--q-ink);
  background: color-mix(in srgb, var(--q-sys) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-sys) 25%, transparent);
  clip-path: var(--notch-sm);
}

.exercise-log-btn {
  width: auto;
  min-height: 0;
  flex-shrink: 0;
  padding: 8px 16px;
}

.exercise-history {
  margin-top: 18px;
}

.exercise-hist-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--q-sys) 10%, transparent);
  font-size: 13px;
}

.exercise-hist-name {
  font-weight: 700;
}

.exercise-hist-detail {
  color: var(--q-dim);
  font-family: "JetBrains Mono", monospace;
  font-size: 12px;
}

.exercise-hist-ago {
  margin-left: auto;
  color: var(--q-dim);
  font-size: 11px;
}

.exercise-hist-del {
  width: auto;
  min-height: 0;
  clip-path: none;
  padding: 2px 8px;
  font-size: 12px;
  color: var(--q-dim);
  background: transparent;
  border: none;
}

/* Unified timeline (Status tab) */
.timeline {
  margin-top: 22px;
}

.timeline-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid color-mix(in srgb, var(--q-sys) 10%, transparent);
}
.timeline-row--clickable {
  cursor: pointer;
}
.timeline-row--clickable:hover {
  background: color-mix(in srgb, var(--q-sys) 6%, transparent);
}
.timeline-row--armed {
  background: color-mix(in srgb, var(--q-sys) 9%, transparent);
}
.timeline-del {
  flex-shrink: 0;
  width: auto;
  min-height: 0;
  margin-left: auto;
  clip-path: var(--notch-sm);
  padding: 5px 12px;
  font-family: "JetBrains Mono", monospace;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #ff6b6b;
  background: color-mix(in srgb, #ff6b6b 12%, transparent);
  border: 1px solid color-mix(in srgb, #ff6b6b 45%, transparent);
  cursor: pointer;
}
.timeline-del:hover {
  background: color-mix(in srgb, #ff6b6b 22%, transparent);
}
.timeline-srchint {
  flex-shrink: 0;
  margin-left: auto;
  font-size: 11px;
  font-style: italic;
  color: var(--q-dim);
}

.timeline-kind {
  flex-shrink: 0;
  width: 64px;
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--q-dim);
}

.timeline-kind--action { color: var(--q-sys); }
.timeline-kind--gym { color: #ff6b6b; }
.timeline-kind--duty,
.timeline-kind--journal { color: #f2c879; }
.timeline-kind--quest { color: #b388ff; }

.timeline-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
}

.timeline-detail {
  color: var(--q-dim);
  font-weight: 400;
}

.timeline-ago {
  flex-shrink: 0;
  color: var(--q-dim);
  font-size: 11px;
}

/* ===== pen additions (subtabs, duty intensity dial, journal editor) ===== */

/* Sub-tabs (Duties | History; journal filter). */
.subtabs,
.journal-filter {
  display: flex;
  gap: 6px;
  margin: 4px 0 12px;
  flex-wrap: wrap;
}
.subtab {
  width: auto;
  min-height: 0;
  clip-path: none;
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--q-dim);
  background: color-mix(in srgb, var(--q-sys) 8%, transparent);
  border: 1px solid var(--q-line);
  cursor: pointer;
}
.subtab--active {
  color: var(--q-ink);
  background: color-mix(in srgb, var(--q-sys) 20%, transparent);
  border-color: var(--q-sys);
}

/* Duties pen. */
.duties-pane {
  display: flex;
  flex-direction: column;
}

/* Intensity dial — horizontal, the priced adverb. Picked first; the chosen tier
   lights up, and that fixes the chip every chore tile below then carries. */
.duty-intensity {
  display: flex;
  gap: 8px;
}
.duty-tier-btn {
  flex: 1;
  min-height: 0;
  padding: 12px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--q-ink);
  background: color-mix(in srgb, var(--q-sys) 6%, transparent);
  border: 1px solid color-mix(in srgb, var(--q-sys) 24%, transparent);
  clip-path: var(--notch-sm);
  cursor: pointer;
}
.duty-tier-btn:not(.duty-tier-btn--on):not(:disabled):hover {
  border-color: color-mix(in srgb, var(--q-sys) 50%, transparent);
  background: color-mix(in srgb, var(--q-sys) 12%, transparent);
}
.duty-tier-btn--on {
  border-color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 18%, transparent);
  color: var(--q-sys);
}
.duty-tier-btn:disabled {
  cursor: default;
}

/* Chore list — vertical, the unpriced noun. Shared pen tiles; dim until an
   intensity is chosen (you can't log a chore without one). */
.duty-chores {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 14px;
}
.duty-chores--idle {
  opacity: 0.45;
}

/* Journal editor. */
.journal-editor {
  border: 1px solid var(--q-line);
  background: var(--q-pnl);
  padding: 12px;
  margin-bottom: 16px;
}
.journal-dial {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.journal-intensity {
  width: auto;
  min-height: 0;
  clip-path: none;
  padding: 5px 11px;
  font-size: 12px;
  color: var(--q-dim);
  background: color-mix(in srgb, var(--q-sys) 8%, transparent);
  border: 1px solid var(--q-line);
  cursor: pointer;
}
.journal-intensity--on {
  color: var(--q-ink);
  border-color: var(--q-sys);
  background: color-mix(in srgb, var(--q-sys) 20%, transparent);
}
.journal-save { margin-left: auto; }
.journal-reread { display: flex; flex-direction: column; gap: 10px; }
.journal-entry-controls { display: inline-flex; align-items: center; gap: 4px; }
.journal-badge {
  width: 22px;
  height: 22px;
  min-height: 0;
  clip-path: none;
  padding: 0;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 700;
  color: var(--q-dim);
  background: transparent;
  border: 1px solid var(--q-line);
  cursor: pointer;
}
.journal-badge--on { color: var(--q-ink); border-color: var(--q-sys); background: color-mix(in srgb, var(--q-sys) 22%, transparent); }
.exercise-cardio-note { font-size: 12px; color: var(--q-dim); padding: 4px 0; }

/* ===== design_v3: character-name → config editor modal ===== */

/* The name doubles as the config-editor trigger — strip the button chrome so it
   still reads as the name, just tappable. */
.character-name-btn {
  width: auto;
  min-height: 0;
  clip-path: none;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.character-name-btn:hover {
  color: var(--q-ink);
  text-decoration: underline dotted color-mix(in srgb, var(--q-sys) 60%, transparent);
  text-underline-offset: 3px;
}

.config-modal {
  width: min(680px, 94vw);
  max-width: 94vw;
}
.config-modal-sub {
  margin: 0 0 10px;
  font-size: 12px;
  color: var(--q-dim);
}
.config-textarea {
  width: 100%;
  min-height: 48vh;
  resize: vertical;
  box-sizing: border-box;
  padding: 12px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.5;
  tab-size: 2;
  color: var(--q-ink);
  background: color-mix(in srgb, var(--q-sys) 6%, var(--q-pnl));
  border: 1px solid var(--q-line);
  clip-path: none;
  white-space: pre;
  overflow: auto;
}
.config-modal-error {
  margin-top: 8px;
  white-space: pre-wrap;
}
.config-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}
.config-modal-spacer { flex: 1; }

/* design_v3: stat colors are config-driven — app.js projects each stat's color
   onto a --stat-<CODE> custom property, and components bind their --c to
   var(--stat-<CODE>). No per-stat class enumeration in code or CSS; this works
   for any stat, including newly-added specializations. */
.payout-chip {
  color: var(--c, var(--q-ink));
  background: color-mix(in srgb, var(--c, var(--q-sys)) 14%, transparent);
}
.hud-bar-fill {
  background: var(--c, var(--q-sys));
  opacity: 0.9;
}
.stat-changed-amount {
  color: var(--c, var(--q-ink));
}
.payout-flash-amt {
  color: var(--c, var(--q-ink));
}
