:root {
  /* App surfaces */
  --bg: #f7efe4;
  --bg-deep: #f0dfc7;
  --panel: rgba(255, 251, 245, 0.88);
  --panel-strong: rgba(255, 248, 240, 0.96);
  --line: rgba(120, 86, 47, 0.14);

  /* App typography */
  --text: #26190e;
  --muted: #6a5748;

  /* App accents */
  --accent: #da6e35;
  --accent-deep: #9f4312;
  --accent-soft: rgba(218, 110, 53, 0.12);
  --teal: #1d7b79;
  --teal-soft: rgba(29, 123, 121, 0.14);
  --nav-accent: #fbf4eb;
  --nav-accent-deep: #f6ede3;
  --nav-accent-text: #978274;

  /* Header controls */
  --header-mist: #9fb7af;
  --header-mist-soft: rgba(159, 183, 175, 0.05);
  --header-mist-mid: rgba(159, 183, 175, 0.12);
  --header-mist-strong: rgba(159, 183, 175, 0.2);
  --header-mist-border: rgba(127, 153, 148, 0.14);
  --header-mist-text: #48616f;
  --header-pill-hover: rgba(223, 231, 227, 0.72);
  --header-pill-active: rgba(210, 221, 216, 0.82);
  --header-pill-border: rgba(140, 161, 153, 0.18);
  --header-pill-text: rgba(86, 103, 98, 0.92);
  --header-nav-hover: rgba(230, 237, 233, 0.66);
  --header-nav-active: rgba(219, 229, 224, 0.78);
  --header-nav-border: rgba(145, 166, 158, 0.16);
  --header-nav-text: rgba(94, 111, 105, 0.92);

  /* Body controls */
  --control-group-surface: rgba(255, 255, 255, 0.72);
  --control-group-border: rgba(101, 73, 46, 0.08);
  --control-text: var(--muted);
  --control-hover-surface: rgba(255, 248, 241, 0.92);
  --control-hover-border-soft: rgba(101, 73, 46, 0.05);
  --control-active-surface: linear-gradient(135deg, var(--nav-accent) 0%, var(--nav-accent-deep) 100%);
  --control-active-text: var(--nav-accent-text);
  --control-active-shadow: 0 4px 8px rgba(110, 86, 71, 0.04);
  --control-border-strong: rgba(101, 73, 46, 0.12);
  --control-surface-strong: rgba(255, 255, 255, 0.76);
  --control-hover-surface-strong: rgba(255, 251, 245, 0.94);
  --control-focus-border: rgba(29, 123, 121, 0.28);
  --control-focus-ring: rgba(29, 123, 121, 0.08);
  --control-focus-inset: rgba(29, 123, 121, 0.12);

  /* Shared effects */
  --gold: #d5aa42;
  --shadow: 0 20px 56px rgba(79, 40, 17, 0.1);
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
  color-scheme: light;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --bg: #121618;
  --bg-deep: #0d1113;
  --panel: rgba(19, 24, 27, 0.88);
  --panel-strong: rgba(21, 27, 30, 0.96);
  --line: rgba(173, 185, 182, 0.12);
  --text: #f1ece3;
  --muted: #b7afa4;

  --nav-accent: rgba(73, 84, 83, 0.92);
  --nav-accent-deep: rgba(56, 66, 65, 0.96);
  --nav-accent-text: #e4ddd1;

  --header-pill-hover: rgba(74, 88, 86, 0.72);
  --header-pill-active: rgba(95, 111, 108, 0.84);
  --header-pill-border: rgba(140, 161, 153, 0.22);
  --header-pill-text: rgba(236, 230, 220, 0.94);
  --header-nav-hover: rgba(61, 73, 71, 0.64);
  --header-nav-active: rgba(82, 96, 93, 0.78);
  --header-nav-border: rgba(145, 166, 158, 0.2);
  --header-nav-text: rgba(232, 225, 214, 0.92);

  --control-group-surface: rgba(29, 36, 39, 0.82);
  --control-group-border: rgba(173, 185, 182, 0.12);
  --control-text: #c8c0b5;
  --control-hover-surface: rgba(43, 52, 56, 0.92);
  --control-hover-border-soft: rgba(173, 185, 182, 0.14);
  --control-active-surface: linear-gradient(135deg, rgba(80, 92, 90, 0.96) 0%, rgba(61, 72, 70, 0.98) 100%);
  --control-active-text: #f1ece3;
  --control-active-shadow: 0 6px 14px rgba(0, 0, 0, 0.24);
  --control-border-strong: rgba(173, 185, 182, 0.16);
  --control-surface-strong: rgba(31, 39, 42, 0.86);
  --control-hover-surface-strong: rgba(40, 48, 52, 0.94);
  --control-focus-border: rgba(128, 165, 159, 0.42);
  --control-focus-ring: rgba(91, 130, 124, 0.18);
  --control-focus-inset: rgba(128, 165, 159, 0.18);

  --shadow: 0 24px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  height: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  background: transparent;
}

body {
  position: relative;
  margin: 0;
  padding-top: var(--app-header-offset, 76px);
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font-ui);
  color: var(--text);
  background: transparent;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body.is-auth-gated {
  padding-top: 0;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 28%),
    linear-gradient(135deg, #f9f3eb 0%, #f2e2cb 48%, #edd7bc 100%);
  pointer-events: none;
}

:root[data-theme="dark"] body::before {
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.06), transparent 28%),
    linear-gradient(145deg, #101517 0%, #161b1e 52%, #0d1113 100%);
}

button,
input,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.background-glow {
  position: fixed;
  z-index: 0;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.7;
  pointer-events: none;
}

.background-glow-left {
  top: 88px;
  left: -100px;
  width: 260px;
  height: 260px;
  background: rgba(213, 170, 66, 0.2);
}

.background-glow-right {
  top: 220px;
  right: -90px;
  width: 280px;
  height: 280px;
  background: rgba(29, 123, 121, 0.18);
}

.auth-screen {
  position: relative;
  z-index: 2;
  display: grid;
  min-height: 100vh;
  min-height: 100dvh;
  place-items: center;
  padding: 32px 18px;
}

.auth-card {
  display: grid;
  width: min(460px, 100%);
  gap: 24px;
  padding: 34px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(255, 252, 248, 0.94), rgba(248, 239, 229, 0.88));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.7),
    0 30px 80px rgba(100, 67, 40, 0.16);
  backdrop-filter: blur(18px);
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  justify-self: start;
}

.auth-copy {
  display: grid;
  gap: 8px;
}

.auth-copy h1,
.auth-copy p {
  margin: 0;
}

.auth-copy h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 8vw, 2.75rem);
  letter-spacing: -0.045em;
}

.auth-copy > p:last-child {
  max-width: 38ch;
  color: var(--muted);
  line-height: 1.55;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(103, 74, 45, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.48);
}

.auth-mode-button {
  min-height: 42px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
}

.auth-mode-button:hover,
.auth-mode-button:focus-visible {
  background: var(--header-pill-hover);
  color: var(--text);
  outline: none;
}

.auth-mode-button.is-active {
  background: var(--header-pill-active);
  color: var(--header-pill-text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.56);
}

.auth-form,
.auth-field {
  display: grid;
}

.auth-field[hidden],
.auth-mode-switch[hidden],
.auth-hint[hidden],
.auth-text-button[hidden] {
  display: none;
}

.auth-form {
  gap: 14px;
}

.auth-field {
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
}

.auth-field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 15px;
  border: 1px solid rgba(103, 74, 45, 0.13);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.auth-password-control {
  position: relative;
}

.auth-password-control input {
  padding-right: 58px;
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 8px;
  display: grid;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 11px;
  place-items: center;
  background: transparent;
  color: var(--muted);
  transform: translateY(-50%);
}

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  background: var(--header-pill-hover);
  color: var(--text);
  outline: none;
}

.auth-password-toggle:focus-visible {
  box-shadow: 0 0 0 3px var(--control-focus-ring);
}

.auth-password-toggle svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.auth-password-slash {
  opacity: 0;
  transition: opacity 140ms ease;
}

.auth-password-toggle.is-visible .auth-password-slash {
  opacity: 1;
}

.auth-field input:focus {
  border-color: var(--control-focus-border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 5px var(--control-focus-ring);
}

.auth-hint,
.auth-status {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.auth-requirement {
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-requirement[hidden] {
  display: none;
}

.auth-requirement-icon {
  display: grid;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(103, 74, 45, 0.2);
  border-radius: 50%;
  place-items: center;
  background: rgba(255, 255, 255, 0.5);
  color: transparent;
  font-size: 0.68rem;
  font-weight: 800;
}

.auth-requirement[data-state="invalid"] {
  color: #a54c3c;
}

.auth-requirement[data-state="invalid"] .auth-requirement-icon {
  border-color: rgba(165, 76, 60, 0.28);
  background: rgba(165, 76, 60, 0.1);
}

.auth-requirement[data-state="invalid"] .auth-requirement-icon::before {
  content: "!";
  color: #a54c3c;
}

.auth-requirement[data-state="valid"] {
  color: #4f746c;
}

.auth-requirement[data-state="valid"] .auth-requirement-icon {
  border-color: rgba(79, 116, 108, 0.28);
  background: rgba(79, 116, 108, 0.12);
}

.auth-requirement[data-state="valid"] .auth-requirement-icon::before {
  content: "✓";
  color: #4f746c;
}

.auth-status:empty {
  min-height: 0;
}

.auth-status[data-tone="error"] {
  color: #a54c3c;
}

.auth-status[data-tone="success"] {
  color: #4f746c;
}

.auth-submit {
  width: 100%;
  min-height: 50px;
  margin-top: 2px;
}

.auth-text-button {
  justify-self: start;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.auth-text-button:hover,
.auth-text-button:focus-visible {
  color: var(--text);
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.auth-back-button {
  justify-self: center;
}

:root[data-theme="dark"] .background-glow-left {
  background: rgba(213, 170, 66, 0.08);
}

:root[data-theme="dark"] .background-glow-right {
  background: rgba(29, 123, 121, 0.1);
}

.app-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding-block: 6px;
  padding-inline: max(16px, calc((100vw - 1400px) / 2));
  border: 1px solid rgba(231, 217, 201, 0.62);
  border-top: 0;
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  background: rgba(255, 251, 247, 0.97);
  box-shadow: 0 8px 20px rgba(74, 46, 24, 0.06);
  backdrop-filter: blur(12px);
}

.app-notice {
  position: fixed;
  top: calc(var(--app-header-offset, 76px) + 14px);
  left: 50%;
  z-index: 24;
  width: min(620px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 1px solid rgba(79, 116, 108, 0.2);
  border-radius: 15px;
  background: rgba(244, 249, 246, 0.96);
  color: #405f58;
  box-shadow: 0 16px 36px rgba(70, 54, 40, 0.14);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  transform: translateX(-50%);
  backdrop-filter: blur(16px);
}

.app-notice[hidden] {
  display: none;
}

.app-brand,
.app-nav-button,
.app-mode-button,
.app-menu-button,
.app-menu-item {
  font: inherit;
}

.app-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 3px 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  color: var(--text);
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease;
}

.app-brand:hover,
.app-brand:focus-visible {
  background: transparent;
  color: var(--text);
  outline: none;
}

.app-nav-button:hover,
.app-nav-button:focus-visible {
  background: var(--header-nav-hover);
  border-color: var(--header-nav-border);
  color: var(--header-nav-text);
  outline: none;
}

.app-menu-button:hover,
.app-menu-button:focus-visible,
.app-mode-button:hover,
.app-mode-button:focus-visible {
  background: var(--header-nav-hover);
  border-color: var(--header-nav-border);
  color: var(--header-nav-text);
  outline: none;
}

.app-brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(220, 151, 94, 0.9), rgba(137, 170, 157, 0.9));
  color: rgba(255, 252, 247, 0.98);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.app-brand-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.app-brand-copy {
  display: grid;
  gap: 1px;
  line-height: 1;
  text-align: left;
}

.app-brand-title {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.app-brand-subtitle {
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.app-nav {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-left: 2px;
  padding: 2px;
}

.app-nav-button,
.app-mode-button,
.app-menu-button {
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 9px 14px;
  background: transparent;
  color: rgba(100, 76, 56, 0.9);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background 180ms ease,
    border-color 180ms ease,
    box-shadow 180ms ease,
    color 180ms ease;
}

.app-mode-button {
  min-width: 60px;
  justify-content: center;
  text-align: center;
}

.app-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.app-mode-switch {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
}

.app-mode-button.is-active {
  background: var(--header-pill-active);
  border-color: var(--header-pill-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  color: var(--header-pill-text);
}

.app-nav-button.is-active {
  background: var(--header-nav-active);
  border-color: var(--header-nav-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  color: var(--header-nav-text);
}

.app-menu {
  position: relative;
}

.app-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 24;
  display: grid;
  gap: 6px;
  width: 240px;
  padding: 8px;
  border: 1px solid rgba(231, 217, 201, 0.72);
  border-radius: 18px;
  background: rgba(255, 251, 247, 0.98);
  box-shadow: 0 18px 40px rgba(74, 46, 24, 0.14);
  backdrop-filter: blur(16px);
}

.app-menu-panel[hidden] {
  display: none;
}

.app-menu-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  border: 0;
  border-radius: 13px;
  padding: 10px 11px;
  background: rgba(255, 253, 250, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: left;
}

.app-menu-item:disabled {
  cursor: default;
}

.app-menu-item span:last-child {
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.7;
}

.app-menu-button[aria-expanded="true"] {
  background: var(--header-pill-active);
  border-color: var(--header-pill-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
  color: var(--header-pill-text);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 var(--app-scroll-spacer, 0px);
}

.hero,
.panel {
  backdrop-filter: blur(12px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(340px, 0.9fr);
  gap: 30px;
  padding: 36px;
  border-radius: 32px;
  overflow: hidden;
  position: relative;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.18) 55%, transparent 100%);
  pointer-events: none;
}

.eyebrow,
.section-kicker,
.stat-label,
.goal-label,
.metric-caption,
.review-note-label {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--muted);
}

.summary-card .metric-caption-spaced {
  padding-top: 15px;
}

.hero h1,
.section-heading h2,
.section-heading h3,
.day-name,
.review-week-title {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 650;
  letter-spacing: -0.03em;
}

.hero h1 {
  font-size: clamp(2.7rem, 5vw, 4.6rem);
  line-height: 0.92;
  max-width: 12ch;
}

.hero-text {
  max-width: 54ch;
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-progress {
  margin-top: 26px;
  max-width: 720px;
}

.hero-progress-card {
  padding: 20px 22px;
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 245, 236, 0.76), rgba(255, 255, 255, 0.54));
  border: 1px solid rgba(170, 79, 30, 0.1);
  box-shadow: 0 16px 30px rgba(81, 47, 22, 0.07);
}

.hero-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: end;
}

.hero-progress-total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text);
}

.hero-progress-foot {
  display: flex;
  justify-content: end;
  margin-top: 6px;
}

.hero-progress-status {
  flex-shrink: 0;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(101, 73, 46, 0.1);
  color: #7a5638;
  font-size: 0.56rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.1;
  white-space: nowrap;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.button {
  border: none;
  border-radius: 999px;
  padding: 14px 20px;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    background 180ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: white;
  box-shadow: 0 18px 30px rgba(159, 67, 18, 0.28);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border: 1px solid rgba(103, 74, 45, 0.12);
}

.hero-panel {
  padding: 22px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(255, 247, 238, 0.94)),
    var(--panel-strong);
  border: 1px solid rgba(101, 72, 43, 0.08);
}

.meta-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 20px;
}

.meta-field,
.inline-field,
.notes-field {
  display: grid;
  gap: 8px;
}

.meta-field > span,
.inline-field > span,
.notes-field > span {
  font-size: 0.82rem;
  color: var(--muted);
}

.meta-field-head > label {
  font-size: 0.82rem;
  color: var(--muted);
}

.meta-field-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.week-shift-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}

.week-shift-button {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(103, 74, 45, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  color: rgba(106, 87, 72, 0.9);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  pointer-events: auto;
  font-size: 0.9rem;
  line-height: 1;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
}

.week-shift-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(103, 74, 45, 0.16);
  box-shadow: 0 8px 18px rgba(101, 72, 43, 0.08);
}

.week-shift-button:focus-visible {
  outline: none;
  border-color: rgba(29, 123, 121, 0.36);
  box-shadow: 0 0 0 4px rgba(29, 123, 121, 0.1);
}

.meta-field input,
.inline-field input,
.inline-field select,
.notes-field textarea {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(98, 68, 43, 0.12);
  background: rgba(255, 255, 255, 0.78);
  color: var(--text);
  padding: 14px 16px;
  outline: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.inline-field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 19px) calc(50% - 2px),
    calc(100% - 14px) calc(50% - 2px);
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 38px;
}

.meta-field input[type="date"] {
  cursor: pointer;
}

.meta-field input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
}

.meta-field input:focus,
.inline-field input:focus,
.inline-field select:focus,
.notes-field textarea:focus {
  border-color: rgba(29, 123, 121, 0.36);
  box-shadow: 0 0 0 4px rgba(29, 123, 121, 0.1);
}

.inline-field input:disabled {
  color: rgba(106, 87, 72, 0.52);
  background: rgba(249, 243, 236, 0.76);
  cursor: not-allowed;
}

.notes-field textarea:disabled {
  color: rgba(106, 87, 72, 0.7);
  background:
    linear-gradient(180deg, rgba(252, 248, 242, 0.84), rgba(249, 243, 236, 0.8));
  cursor: not-allowed;
  box-shadow: inset 0 0 0 1px rgba(101, 73, 46, 0.04);
}

.notes-field textarea:disabled::placeholder {
  color: rgba(106, 87, 72, 0.56);
}

.hero-stats,
.summary-hero,
.summary-grid,
.achievement-list,
.days-grid,
.history-list,
.review-grid {
  display: grid;
  gap: 16px;
}

.hero-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hero-stats .stat-card {
  min-height: 138px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(255, 250, 244, 0.72));
  border-color: rgba(120, 86, 47, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.hero-stats .stat-label {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: rgba(106, 87, 72, 0.78);
}

.hero-stats .stat-value {
  font-size: clamp(1.16rem, 2.05vw, 1.7rem);
  margin-top: 12px;
  font-weight: 650;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.hero-stats .stat-value span {
  font-size: 0.46em;
  color: rgba(106, 87, 72, 0.88);
}

.hero-stats .stat-hint {
  margin-top: 8px;
  font-size: 0.68rem;
  line-height: 1.2;
  color: rgba(106, 87, 72, 0.72);
}

.hero-stats .stat-hint-score-so-far {
  position: absolute;
  right: 20px;
  bottom: 16px;
  margin-top: 0;
  text-align: right;
  white-space: nowrap;
  font-size: 0.64rem;
  max-width: none;
}

.stat-card,
.summary-card,
.history-card,
.review-card,
.achievement-chip,
.metric-row {
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.74);
}

.stat-card,
.summary-card {
  padding: 16px;
}

.stat-value,
.summary-total,
.day-total-value,
.history-total {
  font-size: clamp(1.8rem, 4vw, 2.7rem);
  line-height: 1;
  margin-top: 8px;
  font-weight: 700;
}

.stat-value span,
.summary-total span,
.day-total-value span,
.history-total span {
  font-size: 0.45em;
  color: var(--muted);
}

.stat-card-grade {
  min-width: 0;
}

.stat-value-grade {
  font-size: clamp(1.35rem, 2.6vw, 2.15rem);
  line-height: 1.02;
  white-space: normal;
  overflow-wrap: anywhere;
  max-width: 100%;
}

.hero-stats .stat-value-grade {
  font-size: clamp(1rem, 1.75vw, 1.45rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.hero-stats .stat-value-invalid-trades,
.hero-stats .stat-value-achievements,
.hero-stats .stat-value-weekly-total {
  font-variant-numeric: tabular-nums;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: 0.62fr 1.33fr 1fr;
  grid-template-areas:
    "rules days days"
    "insights insights insights";
  gap: 18px;
  margin-top: 18px;
  align-content: start;
}

.dashboard-grid:has(.panel-days:not(.is-day-view)) {
  grid-template-columns: 1fr;
  grid-template-areas:
    "days"
    "insights";
}

.panel {
  padding: 28px;
  border-radius: 28px;
}

.panel-rules {
  align-self: start;
}

.panel-rules {
  grid-area: rules;
}

.panel-days {
  grid-area: days;
  padding-bottom: 68px;
}

.panel-insights {
  grid-area: insights;
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
}

.app-shell.is-rules-focus .hero,
.app-shell.is-rules-focus .panel-rules,
.app-shell.is-rules-focus .panel-days,
.app-shell.is-rules-focus .insights-tabs {
  display: none;
}

.app-shell.is-rules-focus .dashboard-grid {
  grid-template-columns: 1fr;
  grid-template-areas: "insights";
  margin-top: 0;
}

.app-shell.is-rules-focus .panel-insights {
  padding: 0;
}

.app-header.is-rules-focus .app-nav,
.app-header.is-rules-focus .app-menu {
  display: none;
}

.app-header.is-rules-focus .app-brand {
  pointer-events: none;
}

@media (min-width: 921px) {
  .app-shell:not(:has(#insightsWorkspaceTab:not([hidden]))):has(.panel-insights:not(.is-open)) {
    min-height: 100dvh;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .app-shell:not(:has(#insightsWorkspaceTab:not([hidden]))):has(.panel-insights:not(.is-open)) .dashboard-grid {
    min-height: 0;
    grid-template-rows: max-content minmax(0, 1fr);
  }

  .app-shell:not(:has(#insightsWorkspaceTab:not([hidden]))):has(.panel-insights:not(.is-open)) .panel-insights {
    align-self: stretch;
    display: grid;
    align-content: end;
    padding-bottom: 8px;
  }

  .app-shell:not(:has(#insightsWorkspaceTab:not([hidden]))):has(.panel-insights:not(.is-open)) .insights-tabs {
    justify-self: start;
    margin-left: 0;
  }
}

.section-heading {
  display: grid;
  gap: 6px;
  margin-bottom: 20px;
}

.section-heading.compact {
  margin-bottom: 14px;
}

.section-heading h2,
.section-heading h3 {
  font-size: 1.75rem;
}

.days-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: start;
  margin-bottom: 14px;
}

.days-header .section-heading {
  margin-bottom: 0;
}

.panel-days.is-day-view .days-header {
  width: 100%;
}

.panel-days.is-day-view {
  padding-bottom: 26px;
}

.days-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--control-group-surface);
  border: 1px solid var(--control-group-border);
  margin-left: auto;
  margin-top: 11.6px;
}

.days-tab {
  border: none;
  border-radius: 999px;
  padding: 5px 10px;
  min-width: 58px;
  background: transparent;
  color: var(--control-text);
  font-size: 0.7rem;
  line-height: 1.1;
  font-weight: 550;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.days-tab:hover {
  background: var(--control-hover-surface);
  box-shadow: inset 0 0 0 1px var(--control-hover-border-soft);
}

.days-tab.is-active {
  background: var(--control-active-surface);
  color: var(--control-active-text);
  box-shadow: var(--control-active-shadow);
}

.summary-lens-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--control-group-surface);
  border: 1px solid var(--control-group-border);
  margin-bottom: 14px;
}

.summary-lens-tab {
  border: none;
  border-radius: 999px;
  padding: 6px 12px;
  min-width: 92px;
  background: transparent;
  color: var(--control-text);
  font-size: 0.72rem;
  line-height: 1.1;
  font-weight: 550;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.summary-lens-tab:hover {
  background: var(--control-hover-surface);
  box-shadow: inset 0 0 0 1px var(--control-hover-border-soft);
  color: var(--control-text);
}

.summary-lens-tab.is-active {
  background: var(--control-active-surface);
  color: var(--control-active-text);
  box-shadow: var(--control-active-shadow);
}

.insights-tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  padding: 3px;
  position: sticky;
  top: 12px;
  z-index: 18;
  border-radius: 999px;
  background: var(--control-group-surface);
  border: 1px solid var(--control-group-border);
  justify-self: end;
  margin-left: auto;
  backdrop-filter: blur(10px);
}

.insights-tab {
  border: none;
  border-radius: 999px;
  padding: 5px 10px;
  min-width: 58px;
  background: transparent;
  color: var(--control-text);
  font-size: 0.7rem;
  line-height: 1.1;
  font-weight: 550;
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.insights-tab:hover {
  background: var(--control-hover-surface);
  box-shadow: inset 0 0 0 1px var(--control-hover-border-soft);
}

.insights-tab.is-active {
  background: var(--control-active-surface);
  color: var(--control-active-text);
  box-shadow: var(--control-active-shadow);
}

.insights-content {
  margin-top: 16px;
  margin-bottom: 21px;
  padding: 26px;
  border-radius: var(--radius-xl);
  backdrop-filter: blur(12px);
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: var(--shadow);
  overflow: hidden;
  transform-origin: top right;
  will-change: transform, opacity, clip-path, filter;
}

.archive-layout {
  display: grid;
  grid-template-columns: minmax(190px, 0.42fr) minmax(0, 1.58fr);
  gap: 18px;
  align-items: start;
}

.workspace-layout {
  display: grid;
  grid-template-columns: 0.62fr 1.33fr;
  gap: 18px;
  align-items: start;
}

.workspace-layout:has(.panel-days:not(.is-day-view)) {
  grid-template-columns: 1fr;
}

.dashboard-grid:has(.panel-days:not(.is-day-view)) > .panel-rules,
.workspace-layout:has(.panel-days:not(.is-day-view)) > .panel-rules {
  display: none;
}

.workspace-layout > .panel-rules,
.workspace-layout > .panel-days {
  grid-area: auto;
  margin: 0;
  min-width: 0;
}

.archive-column,
.review-column {
  min-width: 0;
}

.archive-column {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
  min-height: 0;
}

.goal-card {
  padding: 18px;
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, rgba(218, 110, 53, 0.16), rgba(255, 255, 255, 0.4));
  border: 1px solid rgba(170, 79, 30, 0.14);
}

.goal-value {
  margin: 8px 0 0;
  font-size: 1.3rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.rules-list {
  margin: 18px 0 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
  color: var(--muted);
  line-height: 1.55;
}

.rules-editor {
  margin-top: 20px;
  padding: 18px;
  border-radius: 24px;
  border: 1px solid rgba(103, 74, 45, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(248, 242, 235, 0.74));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 16px 28px rgba(121, 96, 78, 0.06);
}

.rules-settings-shell {
  display: grid;
  gap: 18px;
}

.rules-settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 18px;
  align-items: start;
}

.rules-settings-section {
  margin-top: 0;
}

.rules-editor-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.rules-editor-head-copy {
  display: grid;
  max-width: 780px;
  gap: 8px;
}

.rules-example-launch {
  flex: 0 0 auto;
}

.rules-editor-copy {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.rules-editor-goal {
  margin-top: 16px;
}

.rules-goal-textarea {
  min-height: 60px;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
}

.rules-editor-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.rules-editor-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.rules-editor-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-top: 28px;
  border-radius: 999px;
  border: 1px solid rgba(101, 73, 46, 0.08);
  background: rgba(255, 255, 255, 0.58);
  color: #705744;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1;
}

.rules-editor-field {
  min-width: 0;
}

.rules-editor-item-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
}

.rules-editor-icon {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(103, 74, 45, 0.12);
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.rules-editor-icon:hover:not(:disabled),
.rules-editor-icon:focus-visible:not(:disabled) {
  background: rgba(255, 255, 255, 0.9);
  border-color: rgba(29, 123, 121, 0.18);
  transform: translateY(-1px);
  box-shadow: 0 8px 16px rgba(106, 87, 72, 0.08);
}

.rules-editor-icon:focus-visible:not(:disabled) {
  outline: none;
}

.rules-editor-icon:disabled {
  opacity: 0.42;
  cursor: default;
}

.rules-editor-icon.is-destructive:hover:not(:disabled),
.rules-editor-icon.is-destructive:focus-visible:not(:disabled) {
  border-color: rgba(168, 84, 52, 0.22);
  color: #8a431d;
}

.rules-editor-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.rules-editor-spacer {
  flex: 1 1 auto;
}

.rules-editor-button {
  padding: 10px 16px;
  font-size: 0.82rem;
  box-shadow: none;
}

.rules-editor-button:disabled,
.button:disabled {
  opacity: 0.5;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.rules-settings-score-list {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.rules-score-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid rgba(103, 74, 45, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(248, 242, 235, 0.56));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.rules-score-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.rules-score-card-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.rules-score-card-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  color: var(--muted);
}

.rules-score-card-head h4 {
  margin: 0;
  font-size: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
}

.rules-score-card-fields {
  display: grid;
  gap: 12px;
}

.rules-score-lens-field {
  width: min(220px, 100%);
}

.rules-lens-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.rules-lens-label label {
  color: var(--muted);
  font-size: 0.82rem;
}

.rules-lens-label .info-pin-wrap {
  transform: translateY(-1px);
}

.rules-score-list-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.76rem;
}

.rules-editor-validation {
  flex: 1 1 260px;
  margin: 0;
  color: #a54c3c;
  font-size: 0.78rem;
  line-height: 1.45;
}

.rules-editor-scope-note {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.scorecard-rules-empty {
  grid-column: 1 / -1;
  padding: 20px;
  border: 1px dashed rgba(103, 74, 45, 0.16);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.36);
}

.scorecard-rules-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.rules-help-textarea {
  min-height: 60px;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
}

.rules-score-guidance-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-items: start;
}

.rules-score-guidance-field {
  align-self: start;
  align-content: start;
}

.rules-score-guidance-field textarea {
  min-height: 92px;
  line-height: 1.5;
  resize: none;
  overflow: hidden;
}

.rules-settings-footer {
  margin-top: 0;
}

.rules-example-dialog {
  width: min(1040px, calc(100vw - 40px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid rgba(103, 74, 45, 0.12);
  border-radius: 28px;
  color: var(--text);
  background: rgba(253, 249, 244, 0.98);
  overflow: hidden;
  box-shadow:
    0 34px 90px rgba(74, 54, 39, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.rules-example-dialog::backdrop {
  background: rgba(42, 34, 29, 0.36);
  backdrop-filter: blur(8px);
}

.rules-example-dialog-shell {
  display: grid;
  max-height: calc(100dvh - 40px);
  overflow: auto;
  overscroll-behavior: contain;
}

.rules-example-dialog-head {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px 20px;
  border-bottom: 1px solid rgba(103, 74, 45, 0.09);
  background: rgba(253, 249, 244, 0.92);
  backdrop-filter: blur(18px);
}

.rules-example-dialog-head h3,
.rules-example-dialog-head p {
  margin: 0;
}

.rules-example-dialog-head h3 {
  margin-top: 7px;
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.rules-example-dialog-head p:last-child {
  max-width: 650px;
  margin-top: 9px;
  color: var(--muted);
  line-height: 1.5;
}

.rules-example-dialog-close {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(103, 74, 45, 0.12);
  border-radius: 999px;
  place-items: center;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  font-size: 1.2rem;
  line-height: 1;
}

.rules-example-dialog-close:hover,
.rules-example-dialog-close:focus-visible {
  border-color: rgba(29, 123, 121, 0.2);
  background: rgba(255, 255, 255, 0.94);
  outline: none;
}

.rules-preview-lens-guide {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 20px 28px 0;
}

.rules-preview-lens-guide article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(88, 103, 104, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.rules-preview-lens-guide p {
  grid-column: 2;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.rules-preview-lens-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rules-preview-lens-badge.is-process {
  border: 1px solid rgba(79, 121, 116, 0.14);
  background: rgba(176, 202, 194, 0.3);
  color: #496963;
}

.rules-preview-lens-badge.is-execution {
  border: 1px solid rgba(199, 125, 79, 0.15);
  background: rgba(232, 177, 137, 0.24);
  color: #8a5938;
}

.rules-complete-preview-grid {
  display: grid;
  grid-template-columns: minmax(250px, 0.72fr) minmax(0, 1.28fr);
  gap: 16px;
  padding: 20px 28px 28px;
  align-items: start;
}

.rules-preview-framework,
.rules-preview-scorecard {
  padding: 20px;
  border: 1px solid rgba(103, 74, 45, 0.1);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(248, 242, 235, 0.68));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.44);
}

.rules-preview-goal {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(211, 132, 83, 0.16);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(248, 220, 199, 0.58), rgba(255, 255, 255, 0.48));
}

.rules-preview-goal span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.rules-preview-goal strong {
  font-family: var(--font-display);
  font-size: 1.04rem;
  line-height: 1.35;
}

.rules-preview-framework ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.45;
}

.rules-preview-caption {
  margin: 18px 0 0;
  padding-top: 16px;
  border-top: 1px solid rgba(103, 74, 45, 0.08);
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.rules-preview-score-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.rules-preview-score-item {
  padding: 16px;
  border: 1px solid rgba(88, 103, 104, 0.11);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.rules-preview-score-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.rules-preview-score-head h4 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: 1rem;
}

.rules-preview-max-score {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.rules-preview-score-item > p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.rules-preview-score-meanings {
  display: grid;
  gap: 7px;
  margin-top: 14px;
}

.rules-preview-score-meanings > div {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.42;
}

.rules-preview-score-meanings strong {
  display: grid;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  place-items: center;
  background: rgba(79, 101, 116, 0.1);
  color: #526874;
}

.rules-example-dialog-footer {
  position: sticky;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 28px;
  border-top: 1px solid rgba(103, 74, 45, 0.09);
  background: rgba(253, 249, 244, 0.94);
  backdrop-filter: blur(18px);
}

.rules-example-dialog-footer p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.rules-example-dialog-footer > div {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 10px;
}

.account-settings-shell {
  display: grid;
  gap: 18px;
  max-width: 900px;
}

.account-settings-intro {
  display: grid;
  gap: 8px;
}

.account-settings-intro p {
  max-width: 680px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.account-current-card,
.account-profile-list {
  border: 1px solid rgba(103, 74, 45, 0.1);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(248, 242, 235, 0.7));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.42),
    0 16px 28px rgba(121, 96, 78, 0.06);
}

.account-current-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.8fr);
  gap: 18px;
  align-items: end;
  padding: 20px;
}

.account-card-kicker {
  margin: 0 0 7px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.account-current-card h3,
.account-profile-list h3,
.account-profile-card h4 {
  margin: 0;
  font-family: var(--font-display);
  color: var(--text);
}

.account-current-card h3 {
  font-size: 1.5rem;
}

.account-name-field {
  min-width: 0;
}

.account-profile-list {
  padding: 20px;
}

.account-profile-list-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.account-profile-list-head h3 {
  font-size: 1.14rem;
}

.account-profile-grid {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.account-profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 78px;
  padding: 14px;
  border: 1px solid rgba(103, 74, 45, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.56);
}

.account-profile-card.is-active {
  border-color: rgba(111, 151, 145, 0.28);
  background:
    linear-gradient(135deg, rgba(220, 233, 227, 0.54), rgba(255, 247, 237, 0.7));
}

.account-profile-card h4 {
  font-size: 1rem;
}

.account-profile-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 64px;
  padding: 8px 10px;
  border-radius: 999px;
  background: var(--header-pill-active);
  color: var(--header-pill-text);
  font-size: 0.7rem;
  font-weight: 700;
}

.account-settings-footer {
  margin-top: 0;
}

.account-cloud-card {
  align-items: center;
}

.account-sync-block {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-self: end;
  min-width: 190px;
  padding: 13px 15px;
  border: 1px solid rgba(103, 74, 45, 0.1);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.5);
}

.account-sync-block p {
  margin-bottom: 3px;
}

.account-sync-block strong {
  color: var(--text);
  font-size: 0.88rem;
}

.account-sync-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #789c91;
  box-shadow: 0 0 0 5px rgba(120, 156, 145, 0.13);
}

.account-security-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.account-security-card p:not(.section-kicker) {
  max-width: 600px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.account-access-card {
  display: grid;
  gap: 18px;
}

.account-security-badge {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(79, 116, 108, 0.16);
  border-radius: 999px;
  background: rgba(116, 156, 145, 0.12);
  color: #4f746c;
  font-size: 0.7rem;
  font-weight: 750;
}

.account-security-badge.is-warning {
  border-color: rgba(181, 109, 64, 0.18);
  background: rgba(218, 137, 86, 0.12);
  color: #9a5d38;
}

.account-legacy-notice,
.account-security-section {
  border: 1px solid rgba(103, 74, 45, 0.1);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.5);
}

.account-legacy-notice {
  padding: 16px;
}

.account-legacy-notice strong,
.account-security-section strong {
  color: var(--text);
}

.account-legacy-notice p,
.account-security-section p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.account-security-section {
  display: grid;
  grid-template-columns: minmax(180px, 0.7fr) minmax(0, 1.3fr);
  gap: 18px;
  align-items: end;
  padding: 16px;
}

.account-security-controls,
.account-password-grid {
  display: grid;
  gap: 10px;
}

.account-security-controls {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.account-password-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.account-password-grid > .button {
  grid-column: 3;
}

.account-security-field {
  min-width: 0;
}

.account-security-field input {
  min-height: 46px;
}

.account-security-status {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.account-security-status:empty {
  min-height: 0;
}

.account-security-status[data-tone="error"] {
  color: #a54c3c;
}

.account-security-status[data-tone="success"] {
  color: #4f746c;
}

.summary-hero {
  grid-template-columns: minmax(0, 1.1fr) minmax(150px, 0.9fr);
}

.summary-hero-split {
  grid-template-columns: minmax(0, 1.1fr) repeat(2, minmax(220px, 0.75fr));
}

.summary-card-primary {
  background:
    linear-gradient(145deg, rgba(255, 249, 242, 0.88), rgba(252, 246, 238, 0.82));
}

.summary-grade {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  margin-top: 14px;
  max-width: 100%;
  text-align: center;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: anywhere;
}

.grade-progress {
  margin-top: 18px;
}

.grade-progress-hero {
  margin-top: 14px;
}

.grade-progress-summary {
  margin-top: 16px;
}

.grade-progress-track {
  position: relative;
  height: 12px;
  border-radius: 999px;
  overflow: hidden;
  background:
    linear-gradient(
      90deg,
      rgba(218, 110, 53, 0.22) 0%,
      rgba(218, 110, 53, 0.22) 60%,
      rgba(213, 170, 66, 0.22) 60%,
      rgba(213, 170, 66, 0.22) 80%,
      rgba(29, 123, 121, 0.18) 80%,
      rgba(29, 123, 121, 0.18) 90%,
      rgba(29, 123, 121, 0.28) 90%,
      rgba(29, 123, 121, 0.28) 100%
    );
}

.grade-progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 100%);
  box-shadow: 0 10px 18px rgba(29, 123, 121, 0.18);
}

.grade-progress-fill-building,
.grade-progress-fill-attention,
.grade-progress-fill-good,
.grade-progress-fill-a-plus,
.grade-progress-fill-spectrum {
  background: linear-gradient(
    90deg,
    rgba(196, 70, 62, 0.98) 0%,
    rgba(210, 116, 89, 0.96) 24%,
    rgba(205, 160, 116, 0.94) 52%,
    rgba(171, 191, 176, 0.93) 78%,
    rgba(101, 158, 151, 0.95) 100%
  );
  background-repeat: no-repeat;
  background-position: left top;
  background-size: calc(100% / (var(--fill-progress) / 100)) 100%;
  box-shadow: 0 10px 18px rgba(129, 101, 76, 0.11);
}

.grade-progress-fill-in-progress {
  background: linear-gradient(90deg, rgba(210, 173, 138, 0.9) 0%, rgba(194, 212, 210, 0.82) 100%);
  box-shadow: 0 10px 18px rgba(167, 143, 121, 0.12);
}

.grade-progress-labels {
  display: grid;
  grid-template-columns: 60fr 20fr 10fr 10fr;
  gap: 0;
  margin-top: 10px;
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  align-items: start;
}

.grade-progress-labels span {
  text-align: center;
}

.grade-progress-labels-summary {
  margin-top: 8px;
  font-size: 0.64rem;
  letter-spacing: 0.06em;
}

.grade-a-plus {
  background: var(--teal-soft);
  color: #0f5b58;
}

.grade-good {
  background: rgba(213, 170, 66, 0.2);
  color: #7a5300;
}

.grade-attention {
  background: rgba(218, 110, 53, 0.16);
  color: #8a431d;
}

.grade-building {
  background: rgba(170, 111, 52, 0.12);
  color: #7a5638;
}

.grade-in-progress {
  background: rgba(105, 68, 45, 0.08);
  color: #62462b;
}

.summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.metric-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.summary-metric-list {
  width: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 36px 0 0;
}

.metric-row {
  padding: 12px 14px;
}

.score-row.is-not-tested,
.review-metric-row.is-not-tested {
  opacity: 0.84;
}

.score-row.is-not-tested:has(.info-pin-wrap:hover),
.score-row.is-not-tested:has(.info-pin-wrap:focus-visible),
.score-row.is-not-tested:has(.info-pin-wrap:focus-within) {
  position: relative;
  z-index: 4;
  opacity: 1;
}

.score-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 108px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(101, 73, 46, 0.08);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(251, 246, 239, 0.72));
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.score-status-pill-no-trade,
.score-status-pill-not-tested {
  width: 138px;
  min-width: 138px;
  padding: 5px 9px;
  font-size: 0.38rem;
  letter-spacing: 0.08em;
}

.summary-metric-list .metric-row {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(101, 73, 46, 0.06);
}

.summary-metric-section-head {
  display: grid;
  gap: 4px;
  align-self: end;
  margin-top: 6px;
  grid-column: 1 / -1;
}

.summary-support {
  margin-top: 10px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.summary-support-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.metric-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.metric-label {
  font-weight: 600;
}

.metric-label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.metric-score {
  color: var(--muted);
}

.metric-score-no-trade {
  position: absolute;
  top: 8px;
  right: 11px;
  font-size: 0.54rem;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.72;
}

.metric-bar {
  margin-top: 10px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(38, 25, 14, 0.08);
}

.metric-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent) 0%, var(--teal) 100%);
}

.summary-metric-list .metric-bar {
  height: 6px;
  background: rgba(90, 68, 50, 0.04);
}

.summary-metric-list .metric-bar-fill {
  background: linear-gradient(90deg, rgba(216, 140, 88, 0.74) 0%, rgba(120, 164, 160, 0.72) 100%);
  box-shadow: none;
}

.achievement-block {
  margin-top: 22px;
  display: grid;
  gap: 0;
}

.achievement-block.is-populated .achievement-list {
  margin-top: 10px;
}

.achievement-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: fit-content;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
}

.achievement-toggle-state {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.achievement-earned-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: stretch;
  position: relative;
  overflow: visible;
}

.achievement-earned-list:empty {
  display: none;
}

.achievement-panel {
  display: grid;
  gap: 10px;
  position: relative;
  overflow: visible;
}

.achievement-panel[hidden] {
  display: none;
}

.achievement-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: stretch;
  position: relative;
  overflow: visible;
}

.coaching-review {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.coaching-review-intro {
  background:
    linear-gradient(180deg, rgba(255, 251, 246, 0.82), rgba(255, 247, 241, 0.8)),
    linear-gradient(90deg, rgba(216, 140, 88, 0.12) 0%, rgba(120, 164, 160, 0.1) 100%);
  border-color: rgba(101, 73, 46, 0.06);
}

.coaching-review-head {
  display: grid;
  gap: 8px;
}

.coaching-review-title {
  margin: 0;
  font-size: 1.65rem;
  font-family: var(--font-display);
  font-weight: 650;
}

.coaching-review-verdict {
  margin: 0;
  max-width: 68ch;
}

.coaching-review-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.coaching-review-card {
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.68), rgba(255, 252, 248, 0.68)),
    linear-gradient(90deg, rgba(216, 140, 88, 0.08) 0%, rgba(120, 164, 160, 0.08) 100%);
  border-color: rgba(101, 73, 46, 0.06);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.coaching-review-focus {
  margin-top: 8px;
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--text);
}

.coaching-review-copy {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.coaching-review-list {
  margin: 10px 0 0;
  padding-left: 17px;
  color: var(--muted);
  display: grid;
  gap: 10px;
  line-height: 1.45;
}

.coaching-review-plan {
  margin-top: 12px;
}

.achievement-chip {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 80px;
  padding: 14px 16px;
  color: rgba(106, 87, 72, 0.84);
  border: 1px solid rgba(101, 73, 46, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
  min-width: 0;
  flex: 0 1 auto;
  overflow: visible;
  z-index: 0;
}

.achievement-chip-entering {
  animation: rise-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.achievement-chip.is-earned {
  background: linear-gradient(135deg, rgba(213, 170, 66, 0.15), rgba(29, 123, 121, 0.1));
  color: var(--text);
}

.achievement-chip.is-preview {
  padding: 14px 16px;
}

.achievement-chip-earned-preview {
  background: linear-gradient(135deg, rgba(255, 250, 244, 0.88), rgba(249, 243, 233, 0.84));
  box-shadow: 0 8px 16px rgba(79, 40, 17, 0.04);
}

.achievement-badge {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(38, 25, 14, 0.08);
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  color: rgba(101, 73, 46, 0.62);
}

.achievement-chip.is-earned .achievement-badge {
  background: rgba(213, 170, 66, 0.18);
  color: #7b571a;
}

.achievement-chip .metric-label {
  font-size: 0.88rem;
  line-height: 1.06;
}

.achievement-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  z-index: 40;
  width: min(210px, calc(100vw - 40px));
  padding: 7px 9px;
  border-radius: 12px;
  border: 1px solid rgba(101, 73, 46, 0.1);
  background: rgba(255, 251, 245, 0.98);
  box-shadow: 0 6px 14px rgba(79, 40, 17, 0.06);
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-50%) translateY(-3px);
  transition:
    opacity 160ms ease,
    transform 160ms ease,
    visibility 160ms ease;
  pointer-events: none;
}

.achievement-chip:hover .achievement-tooltip,
.achievement-chip:focus-visible .achievement-tooltip,
.achievement-chip:focus-within .achievement-tooltip {
  display: block;
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.achievement-chip:hover,
.achievement-chip:focus-visible,
.achievement-chip:focus-within {
  z-index: 6;
}

.achievement-chip:focus-visible {
  outline: 2px solid rgba(29, 123, 121, 0.22);
  outline-offset: 2px;
}

@media (min-width: 980px) {
  .achievement-earned-list,
  .achievement-list {
    flex-wrap: nowrap;
  }

  .achievement-earned-list .achievement-chip,
  .achievement-list .achievement-chip {
    flex: 0 0 calc((100% - 50px) / 6);
    max-width: calc((100% - 50px) / 6);
  }
}

.days-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.days-grid.is-single-day {
  grid-template-columns: minmax(0, 1fr);
}

.day-nav {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}

.day-nav-pills {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.day-nav-arrow,
.day-nav-pill {
  border: 1px solid var(--control-border-strong);
  background: var(--control-group-surface);
  color: var(--control-text);
  transition:
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.day-nav-arrow {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  font-size: 0.92rem;
  line-height: 1;
}

.day-nav-pill {
  border-radius: 999px;
  padding: 7px 10px;
  font-size: 0.8rem;
  line-height: 1.1;
  font-weight: 550;
}

.day-nav-arrow:hover:not(:disabled),
.day-nav-pill:hover {
  background: var(--control-hover-surface);
  box-shadow: inset 0 0 0 1px var(--control-hover-border-soft);
}

.day-nav-pill.is-active {
  background: var(--control-active-surface);
  color: var(--control-active-text);
  box-shadow: 0 5px 10px rgba(110, 86, 71, 0.05);
}

.day-nav-arrow:disabled {
  opacity: 0.38;
  cursor: default;
}

.day-card {
  position: relative;
  overflow: visible;
  padding: 22px;
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88), rgba(250, 241, 230, 0.92));
  border: 1px solid rgba(101, 73, 46, 0.12);
  box-shadow: 0 16px 34px rgba(81, 47, 22, 0.07);
  animation: rise-in 480ms ease both;
}

/* Keep an open daily-card tooltip above the following insight panel. */
.panel-days.has-open-tooltip,
.panel-days:has(.info-pin-wrap:hover),
.panel-days:has(.info-pin-wrap:focus-visible),
.panel-days:has(.info-pin-wrap:focus-within) {
  position: relative;
  z-index: 3;
}

.day-card.has-open-tooltip,
.day-card:has(.info-pin-wrap:hover),
.day-card:has(.info-pin-wrap:focus-visible),
.day-card:has(.info-pin-wrap:focus-within) {
  z-index: 3;
}

.day-card[data-day-card="fri"].has-finish-week-button {
  padding-bottom: 20px;
}

.day-card::after {
  content: "";
  position: absolute;
  top: -44px;
  right: -44px;
  width: 130px;
  height: 130px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(29, 123, 121, 0.13), transparent 72%);
  pointer-events: none;
}

.day-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 18px;
}

.day-tag {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.day-tag-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.day-status-badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(218, 110, 53, 0.16), rgba(159, 67, 18, 0.24));
  border: 1px solid rgba(159, 67, 18, 0.16);
  color: #8a431d;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform-origin: left center;
  animation: badge-soft-enter 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.day-status-badge.is-event-stand-down {
  background: linear-gradient(135deg, rgba(205, 169, 89, 0.18), rgba(111, 148, 141, 0.2));
  border-color: rgba(111, 148, 141, 0.2);
  color: #506c66;
}

@keyframes badge-soft-enter {
  from {
    opacity: 0;
    transform: translateY(-1px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.day-name {
  font-size: 1.55rem;
}

.day-total {
  text-align: right;
}

.day-total-label {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-bottom: 6px;
}

.score-grid {
  display: grid;
  gap: 12px;
  font-size: larger;
}

.score-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}

.score-label-row,
.field-label-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.score-label {
  font-weight: 600;
  line-height: 1.3;
}

.info-pin-wrap {
  --tooltip-x: -50%;
  --tooltip-hidden-y: 4px;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  outline: none;
  cursor: help;
}

.info-pin-wrap[data-tooltip-side="top"] {
  --tooltip-hidden-y: -4px;
}

.info-pin-wrap[data-tooltip-align="left"],
.info-pin-wrap[data-tooltip-align="right"] {
  --tooltip-x: 0;
}

.info-pin {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  border: 1px solid rgba(101, 73, 46, 0.12);
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
  font-size: 0.5rem;
  font-weight: 700;
  line-height: 1;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease;
}

.info-pin-wrap:hover .info-pin,
.info-pin-wrap:focus-visible .info-pin,
.info-pin-wrap:focus-within .info-pin {
  transform: translateY(-1px);
  border-color: rgba(29, 123, 121, 0.18);
  background: rgba(255, 251, 245, 0.96);
  color: #5f4f42;
}

.info-tooltip {
  display: none;
  position: absolute;
  left: 50%;
  top: calc(100% + 8px);
  z-index: 30;
  width: min(300px, calc(100vw - 36px));
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid rgba(101, 73, 46, 0.1);
  background: #fffaf5;
  box-shadow: 0 18px 30px rgba(79, 40, 17, 0.12);
  color: var(--muted);
  line-height: 1.5;
  isolation: isolate;
  transform: translateX(var(--tooltip-x));
  transition: none;
  pointer-events: none;
  cursor: help;
}

.info-pin-wrap:hover .info-tooltip,
.info-pin-wrap:focus-visible .info-tooltip,
.info-pin-wrap:focus-within .info-tooltip {
  display: block;
  pointer-events: auto;
}

.info-pin-wrap[data-tooltip-side="top"] .info-tooltip {
  top: auto;
  bottom: calc(100% + 8px);
}

.info-pin-wrap[data-tooltip-align="left"] .info-tooltip {
  left: 0;
}

.info-pin-wrap[data-tooltip-align="right"] .info-tooltip {
  left: auto;
  right: 0;
}

.info-tooltip-title {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 700;
  font-size: 0.96rem;
}

.info-tooltip-intro {
  display: block;
  font-size: 0.88rem;
}

.info-tooltip-rules {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  font-size: 0.88rem;
}

.info-tooltip-rule strong {
  color: var(--text);
}

.score-help {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.segmented-control {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 6px;
  padding: 6px;
  border-radius: 999px;
  background: rgba(38, 25, 14, 0.06);
  font-size: inherit;
}

.score-button {
  min-width: 38px;
  height: 38px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  font-size: inherit;
  box-shadow:
    inset 0 0 0 1px transparent,
    0 0 0 rgba(106, 87, 72, 0);
  transition:
    filter 180ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 220ms cubic-bezier(0.22, 1, 0.36, 1),
    background 220ms cubic-bezier(0.22, 1, 0.36, 1),
    color 180ms cubic-bezier(0.22, 1, 0.36, 1);
}

.score-button.is-selected {
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  color: white;
  box-shadow: 0 10px 18px rgba(159, 67, 18, 0.24);
}

.score-button:hover:not(.is-selected),
.score-button:focus-visible:not(.is-selected) {
  background: linear-gradient(135deg, rgba(241, 237, 232, 0.96) 0%, rgba(222, 214, 206, 0.9) 100%);
  color: #5c5147;
  box-shadow:
    inset 0 0 0 1px rgba(101, 73, 46, 0.08),
    0 8px 16px rgba(106, 87, 72, 0.08);
}

.score-button.is-selected:hover,
.score-button.is-selected:focus-visible {
  filter: saturate(0.9) brightness(0.98);
  box-shadow: 0 8px 16px rgba(121, 96, 78, 0.16);
}

.day-footer {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.trade-outcomes {
  display: grid;
  gap: 10px;
  margin-top: 18px;
  padding: 0;
  border: 0;
  background: transparent;
}

.trade-outcome-week-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.trade-outcomes-caption,
.trade-outcomes-empty,
.trade-outcome-week-insight {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.trade-outcomes.is-disabled {
  background: transparent;
}

.trade-outcome-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.trade-outcome-add {
  min-height: 34px;
  padding: 7px 9px;
  border: 1px solid rgba(101, 73, 46, 0.1);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.2;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.trade-outcome-add:hover,
.trade-outcome-add:focus-visible {
  border-color: rgba(29, 123, 121, 0.22);
  background: rgba(247, 249, 244, 0.9);
  color: var(--text);
}

.trade-outcome-add:focus-visible,
.trade-outcome-remove:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(29, 123, 121, 0.1);
}

.trade-outcome-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.trade-outcome-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 10px 7px 10px 9px;
  border: 1px solid rgba(101, 73, 46, 0.08);
  border-radius: 999px;
  color: #625042;
  font-size: 0.68rem;
  line-height: 1.2;
  background: rgba(255, 255, 255, 0.68);
}

.trade-outcome-chip-processWin,
.trade-outcome-chip-processLoss,
.trade-outcome-week-item-processWin,
.trade-outcome-week-item-processLoss {
  background: linear-gradient(135deg, rgba(235, 221, 183, 0.42), rgba(157, 192, 183, 0.22));
}

.trade-outcome-chip-offPlanWin,
.trade-outcome-chip-offPlanLoss,
.trade-outcome-week-item-offPlanWin,
.trade-outcome-week-item-offPlanLoss {
  background: linear-gradient(135deg, rgba(242, 211, 193, 0.48), rgba(230, 183, 151, 0.2));
}

.trade-outcome-remove {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(101, 73, 46, 0.1);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1;
}

.trade-outcome-remove:hover {
  background: rgba(159, 67, 18, 0.16);
  color: #8a431d;
}

.trade-outcome-week-summary {
  display: grid;
  gap: 12px;
  margin-top: 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(250, 242, 231, 0.68));
}

.trade-outcome-week-summary.is-review {
  margin-top: 0;
}

/* Let the outcome-mix help layer above the summary panel without changing its resting layout. */
.insights-content:has(.trade-outcome-week-summary .info-pin-wrap:hover),
.insights-content:has(.trade-outcome-week-summary .info-pin-wrap:focus-visible),
.insights-content:has(.trade-outcome-week-summary .info-pin-wrap:focus-within) {
  position: relative;
  z-index: 4;
  overflow: visible;
}

.trade-outcome-week-summary:has(.info-pin-wrap:hover),
.trade-outcome-week-summary:has(.info-pin-wrap:focus-visible),
.trade-outcome-week-summary:has(.info-pin-wrap:focus-within) {
  position: relative;
  z-index: 5;
}

.trade-outcome-week-summary .info-tooltip {
  z-index: 6;
}

.trade-outcome-week-total {
  margin-top: 4px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 600;
}

.trade-outcome-week-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.trade-outcome-week-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(101, 73, 46, 0.07);
  border-radius: 12px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.2;
}

.trade-outcome-week-item strong {
  color: var(--text);
  font-size: 1rem;
}

@media (max-width: 720px) {
  .trade-outcome-week-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.finish-week-button {
  justify-self: start;
  padding: 10px 14px;
  border: 1px solid rgba(101, 73, 46, 0.12);
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(255, 249, 242, 0.94), rgba(246, 236, 224, 0.9));
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  box-shadow: 0 8px 16px rgba(101, 73, 46, 0.08);
  transition:
    box-shadow 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease;
}

.finish-week-button:hover {
  background: var(--control-hover-surface);
  border-color: rgba(101, 73, 46, 0.16);
  box-shadow: inset 0 0 0 1px var(--control-hover-border-soft);
}

.finish-week-button:focus-visible {
  outline: none;
  border-color: var(--control-focus-border);
  box-shadow:
    inset 0 0 0 1px var(--control-hover-border-soft),
    0 0 0 4px var(--control-focus-ring);
}

.notes-field textarea {
  min-height: 53px;
  resize: none;
  overflow: hidden;
}

.notes-field textarea::placeholder {
  color: rgba(101, 73, 46, 0.28);
}

.day-mode-empty {
  padding: 22px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(101, 73, 46, 0.2);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
  line-height: 1.6;
}

.history-list {
  grid-template-columns: 1fr;
  align-content: start;
  align-items: start;
  grid-auto-rows: max-content;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 2px 0 10px;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.history-list:hover,
.history-list:focus-within {
  scrollbar-color: rgba(101, 73, 46, 0.22) transparent;
}

.history-list::-webkit-scrollbar {
  width: 8px;
}

.history-list::-webkit-scrollbar-track {
  background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
}

.history-list:hover::-webkit-scrollbar-thumb,
.history-list:focus-within::-webkit-scrollbar-thumb {
  background: rgba(101, 73, 46, 0.22);
}

.history-empty,
.review-empty {
  padding: 18px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(101, 73, 46, 0.2);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.5);
}

.history-card {
  width: min(80%, 420px);
  max-width: 100%;
  margin: 0;
  margin-left: 8%;
  text-align: left;
  padding: 14px;
  overflow: hidden;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.history-card:hover,
.history-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(29, 123, 121, 0.26);
  box-shadow: 0 16px 26px rgba(29, 123, 121, 0.12);
}

.history-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.history-meta > div:first-child {
  min-width: 0;
}

.history-title {
  margin: 6px 0 0;
  font-size: 1rem;
  font-family: var(--font-display);
  font-weight: 600;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.history-total {
  flex-shrink: 0;
  text-align: right;
}

.history-grade {
  margin-top: 10px;
  display: inline-flex;
  white-space: nowrap;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: rgba(38, 25, 14, 0.06);
}

.history-spark {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 5px;
  align-items: end;
  height: 44px;
  margin-top: 12px;
}

.history-spark-bar {
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, rgba(29, 123, 121, 0.8), rgba(218, 110, 53, 0.8));
}

.review-content {
  min-height: 100%;
}

.review-summary {
  display: grid;
  gap: 12px;
}

.review-summary-head {
  display: grid;
  gap: 12px;
}

.review-grade-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.review-grade-row .summary-grade {
  margin-top: 0;
  flex: 0 0 auto;
}

.review-controls {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  flex: 0 0 auto;
}

.review-shift-controls {
  gap: 6px;
}

.review-shift-controls .week-shift-button:disabled {
  opacity: 0.42;
  cursor: default;
  transform: none;
  box-shadow: none;
}

.review-shift-controls .week-shift-button:disabled:hover {
  transform: none;
  background: rgba(255, 255, 255, 0.5);
  border-color: rgba(103, 74, 45, 0.1);
  box-shadow: none;
}

.review-density-toggle {
  border: 1px solid var(--control-border-strong);
  border-radius: 999px;
  padding: 7px 11px;
  background: var(--control-surface-strong);
  color: var(--control-text);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.1;
  white-space: nowrap;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease;
  align-self: center;
}

.review-density-toggle:hover {
  background: var(--control-hover-surface-strong);
  border-color: rgba(29, 123, 121, 0.18);
  color: var(--text);
}

.review-density-toggle.is-detailed-target:hover {
  box-shadow: inset 0 0 0 1px var(--control-focus-inset);
}

.review-density-toggle.is-compact-target:hover {
  border-color: rgba(101, 73, 46, 0.08);
  background: rgba(255, 255, 255, 0.68);
}

.review-density-toggle.is-hover-lock-detailed {
  box-shadow: inset 0 0 0 1px var(--control-focus-inset);
}

.review-density-toggle.is-hover-lock-compact {
  border-color: rgba(101, 73, 46, 0.08);
  background: rgba(255, 255, 255, 0.68);
}

.review-week-title {
  font-size: 2rem;
}

.review-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.review-card {
  padding: 14px;
}

.review-grid:not(.is-compact) .day-status-badge {
  padding: 3px 6px;
  font-size: 0.6rem;
  line-height: 1;
}

.review-grid.is-compact {
  gap: 8px;
}

.review-grid.is-compact .review-card {
  padding: 10px;
}

.review-grid.is-compact .review-card-header {
  gap: 7px;
}

.review-grid.is-compact .review-day-meta {
  gap: 5px;
}

.review-grid.is-compact .day-status-badge {
  padding: 3px 6px;
  font-size: 0.6rem;
  line-height: 1;
}

.review-grid.is-compact .day-name {
  font-size: 1.18rem;
}

.review-grid.is-compact .history-total {
  font-size: 1.12em;
  line-height: 0.96;
  letter-spacing: -0.03em;
}

.review-grid.is-compact .history-total span {
  font-size: 0.5em;
}

.review-grid.is-compact .metric-list {
  gap: 5px;
  margin-top: 8px;
}

.review-grid.is-compact .metric-row {
  padding: 6px 8px;
  border-radius: 13px;
}

.review-grid .review-metric-row {
  display: grid;
  gap: 5px;
}

.review-grid.is-compact .review-metric-row {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 242, 235, 0.74));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.review-grid .review-metric-bar {
  height: 2px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(38, 25, 14, 0.06);
}

.review-grid .review-metric-bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, rgba(216, 140, 88, 0.74) 0%, rgba(120, 164, 160, 0.72) 100%);
}

.review-metric-bar.is-placeholder {
  visibility: hidden;
}

.review-grid.is-compact .metric-label,
.review-grid.is-compact .metric-score {
  font-size: 0.82rem;
  line-height: 1.18;
}

.review-grid.is-compact .metric-score.metric-score-no-trade {
  font-size: 0.4rem;
  line-height: 1;
}

.review-grid.is-compact .review-note-label {
  margin-top: 6px;
  font-size: 0.66rem;
}

.review-grid.is-compact .review-note-peek {
  position: relative;
  z-index: 3;
  margin-top: 6px;
  display: inline-flex;
  align-items: flex-start;
}

.review-grid.is-compact .review-note-toggle {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  cursor: pointer;
  border-radius: 999px;
  border: 1px solid var(--control-border-strong);
  background: var(--control-group-surface);
  padding: 4px 8px;
  color: var(--control-text);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.review-grid.is-compact .review-note-toggle::after {
  content: " +";
  margin-left: 4px;
  opacity: 0.7;
}

.review-grid.is-compact .review-note-peek:hover .review-note-toggle::after,
.review-grid.is-compact .review-note-peek:focus-within .review-note-toggle::after {
  content: " -";
}

.review-grid.is-compact .review-note-peek:hover .review-note-toggle,
.review-grid.is-compact .review-note-peek:focus-within .review-note-toggle {
  transform: translateY(-1px);
  background: var(--control-hover-surface-strong);
  border-color: rgba(29, 123, 121, 0.18);
  color: var(--text);
  box-shadow: 0 8px 14px rgba(79, 40, 17, 0.08);
}

:root[data-theme="dark"] .app-header {
  border-color: rgba(173, 185, 182, 0.1);
  background: rgba(12, 17, 19, 0.9);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .app-notice {
  border-color: rgba(159, 183, 175, 0.2);
  background: rgba(28, 38, 39, 0.96);
  color: #b8d2ca;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
}

:root[data-theme="dark"] .auth-card {
  border-color: rgba(173, 185, 182, 0.12);
  background:
    linear-gradient(145deg, rgba(27, 34, 37, 0.96), rgba(17, 23, 25, 0.94));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.035),
    0 30px 80px rgba(0, 0, 0, 0.38);
}

:root[data-theme="dark"] .auth-mode-switch,
:root[data-theme="dark"] .auth-field input,
:root[data-theme="dark"] .account-sync-block {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(34, 42, 45, 0.82);
}

:root[data-theme="dark"] .auth-field input:focus {
  background: rgba(39, 47, 50, 0.96);
}

:root[data-theme="dark"] .auth-status[data-tone="error"] {
  color: #e5a184;
}

:root[data-theme="dark"] .auth-status[data-tone="success"] {
  color: #9fc1b7;
}

:root[data-theme="dark"] .auth-requirement[data-state="invalid"] {
  color: #e5a184;
}

:root[data-theme="dark"] .auth-requirement[data-state="valid"] {
  color: #9fc1b7;
}

:root[data-theme="dark"] .app-nav-button,
:root[data-theme="dark"] .app-mode-button,
:root[data-theme="dark"] .app-menu-button {
  color: rgba(214, 209, 199, 0.92);
}

:root[data-theme="dark"] .app-menu-panel {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(17, 23, 25, 0.96);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .app-menu-item {
  background: rgba(34, 42, 45, 0.82);
  color: #d6cec2;
}

:root[data-theme="dark"] .hero,
:root[data-theme="dark"] .panel {
  border-color: rgba(173, 185, 182, 0.1);
}

:root[data-theme="dark"] .insights-content {
  border-color: rgba(173, 185, 182, 0.1);
}

:root[data-theme="dark"] .hero::after {
  background:
    linear-gradient(120deg, transparent 0%, rgba(255, 255, 255, 0.04) 55%, transparent 100%);
}

:root[data-theme="dark"] .hero-progress-card {
  background:
    linear-gradient(145deg, rgba(36, 44, 47, 0.88), rgba(23, 29, 32, 0.74));
  border-color: rgba(173, 185, 182, 0.1);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .hero-progress-status {
  background: rgba(37, 45, 48, 0.88);
  border-color: rgba(173, 185, 182, 0.12);
  color: #c3b9aa;
}

:root[data-theme="dark"] .button-secondary {
  background: rgba(36, 43, 46, 0.9);
  border-color: rgba(173, 185, 182, 0.12);
}

:root[data-theme="dark"] .rules-editor-icon {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(35, 43, 46, 0.9);
  color: #d8d0c4;
}

:root[data-theme="dark"] .rules-editor-icon:hover:not(:disabled),
:root[data-theme="dark"] .rules-editor-icon:focus-visible:not(:disabled) {
  background: rgba(43, 51, 55, 0.96);
  border-color: rgba(128, 165, 159, 0.24);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .rules-editor {
  border-color: rgba(173, 185, 182, 0.1);
  background:
    linear-gradient(180deg, rgba(30, 37, 40, 0.88), rgba(22, 28, 31, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 16px 28px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .rules-editor-copy {
  color: rgba(197, 190, 179, 0.78);
}

:root[data-theme="dark"] .rules-score-card {
  border-color: rgba(173, 185, 182, 0.1);
  background:
    linear-gradient(180deg, rgba(34, 41, 44, 0.86), rgba(25, 31, 34, 0.82));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .scorecard-rules-empty {
  border-color: rgba(173, 185, 182, 0.14);
  background: rgba(30, 37, 40, 0.5);
}

:root[data-theme="dark"] .rules-score-card-kicker {
  color: rgba(197, 190, 179, 0.78);
}

:root[data-theme="dark"] .rules-score-card-head h4 {
  color: #f1ece3;
}

:root[data-theme="dark"] .rules-example-dialog {
  border-color: rgba(173, 185, 182, 0.14);
  color: #f1ece3;
  background: rgba(18, 24, 27, 0.98);
  box-shadow:
    0 38px 100px rgba(0, 0, 0, 0.52),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

:root[data-theme="dark"] .rules-example-dialog::backdrop {
  background: rgba(4, 8, 10, 0.64);
}

:root[data-theme="dark"] .rules-example-dialog-head,
:root[data-theme="dark"] .rules-example-dialog-footer {
  border-color: rgba(173, 185, 182, 0.1);
  background: rgba(18, 24, 27, 0.92);
}

:root[data-theme="dark"] .rules-example-dialog-close {
  border-color: rgba(173, 185, 182, 0.14);
  background: rgba(35, 43, 46, 0.9);
  color: #f1ece3;
}

:root[data-theme="dark"] .rules-example-dialog-close:hover,
:root[data-theme="dark"] .rules-example-dialog-close:focus-visible {
  border-color: rgba(128, 165, 159, 0.26);
  background: rgba(43, 51, 55, 0.96);
}

:root[data-theme="dark"] .rules-preview-lens-guide article,
:root[data-theme="dark"] .rules-preview-score-item {
  border-color: rgba(173, 185, 182, 0.1);
  background: rgba(33, 41, 44, 0.72);
}

:root[data-theme="dark"] .rules-preview-framework,
:root[data-theme="dark"] .rules-preview-scorecard {
  border-color: rgba(173, 185, 182, 0.1);
  background:
    linear-gradient(180deg, rgba(30, 37, 40, 0.9), rgba(22, 28, 31, 0.86));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .rules-preview-goal {
  border-color: rgba(214, 128, 76, 0.18);
  background:
    linear-gradient(135deg, rgba(89, 54, 38, 0.42), rgba(32, 39, 41, 0.56));
}

:root[data-theme="dark"] .rules-preview-caption {
  border-color: rgba(173, 185, 182, 0.09);
}

:root[data-theme="dark"] .rules-preview-lens-badge.is-process {
  border-color: rgba(159, 183, 175, 0.18);
  background: rgba(104, 143, 135, 0.22);
  color: #b8d2ca;
}

:root[data-theme="dark"] .rules-preview-lens-badge.is-execution {
  border-color: rgba(218, 137, 86, 0.18);
  background: rgba(170, 94, 50, 0.22);
  color: #e9b18d;
}

:root[data-theme="dark"] .rules-preview-score-meanings strong {
  background: rgba(159, 183, 175, 0.12);
  color: #b8cec6;
}

:root[data-theme="dark"] .account-current-card,
:root[data-theme="dark"] .account-profile-list {
  border-color: rgba(173, 185, 182, 0.1);
  background:
    linear-gradient(180deg, rgba(30, 37, 40, 0.88), rgba(22, 28, 31, 0.82));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.03),
    0 16px 28px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .account-settings-intro p,
:root[data-theme="dark"] .account-card-kicker {
  color: rgba(197, 190, 179, 0.78);
}

:root[data-theme="dark"] .account-current-card h3,
:root[data-theme="dark"] .account-profile-list h3,
:root[data-theme="dark"] .account-profile-card h4 {
  color: #f1ece3;
}

:root[data-theme="dark"] .account-profile-card {
  border-color: rgba(173, 185, 182, 0.1);
  background: rgba(35, 43, 46, 0.8);
}

:root[data-theme="dark"] .account-profile-card.is-active {
  border-color: rgba(128, 165, 159, 0.24);
  background:
    linear-gradient(135deg, rgba(42, 61, 60, 0.84), rgba(38, 40, 37, 0.86));
}

:root[data-theme="dark"] .account-legacy-notice,
:root[data-theme="dark"] .account-security-section {
  border-color: rgba(173, 185, 182, 0.1);
  background: rgba(35, 43, 46, 0.72);
}

:root[data-theme="dark"] .account-security-badge {
  border-color: rgba(159, 183, 175, 0.18);
  background: rgba(104, 143, 135, 0.22);
  color: #b8d2ca;
}

:root[data-theme="dark"] .account-security-badge.is-warning {
  border-color: rgba(218, 137, 86, 0.18);
  background: rgba(170, 94, 50, 0.22);
  color: #e9b18d;
}

:root[data-theme="dark"] .account-security-status[data-tone="error"] {
  color: #e5a184;
}

:root[data-theme="dark"] .account-security-status[data-tone="success"] {
  color: #9fc1b7;
}

:root[data-theme="dark"] .rules-editor-index {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(35, 43, 46, 0.92);
  color: #d7cec1;
}

:root[data-theme="dark"] .rules-editor-icon.is-destructive:hover:not(:disabled),
:root[data-theme="dark"] .rules-editor-icon.is-destructive:focus-visible:not(:disabled) {
  border-color: rgba(203, 129, 96, 0.24);
  color: #ebc1a7;
}

:root[data-theme="dark"] .hero-panel {
  background:
    linear-gradient(180deg, rgba(31, 38, 41, 0.72), rgba(18, 24, 27, 0.96)),
    var(--panel-strong);
  border-color: rgba(173, 185, 182, 0.1);
}

:root[data-theme="dark"] .week-shift-button {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(29, 36, 39, 0.82);
  color: #d2c9bc;
}

:root[data-theme="dark"] .week-shift-button:hover {
  background: rgba(40, 48, 52, 0.94);
  border-color: rgba(173, 185, 182, 0.18);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .meta-field input,
:root[data-theme="dark"] .inline-field input,
:root[data-theme="dark"] .inline-field select,
:root[data-theme="dark"] .notes-field textarea {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(26, 33, 36, 0.92);
  color: var(--text);
}

:root[data-theme="dark"] .meta-field input::placeholder,
:root[data-theme="dark"] .inline-field input::placeholder,
:root[data-theme="dark"] .notes-field textarea::placeholder {
  color: rgba(183, 175, 164, 0.56);
}

:root[data-theme="dark"] .meta-field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.88) brightness(0.96);
}

:root[data-theme="dark"] .inline-field input:disabled {
  color: rgba(183, 175, 164, 0.48);
  background: rgba(22, 28, 31, 0.9);
}

:root[data-theme="dark"] .rules-editor-validation {
  color: #e5a184;
}

:root[data-theme="dark"] .notes-field textarea:disabled {
  color: rgba(183, 175, 164, 0.64);
  background:
    linear-gradient(180deg, rgba(30, 37, 40, 0.92), rgba(20, 26, 29, 0.88));
  box-shadow: inset 0 0 0 1px rgba(173, 185, 182, 0.06);
}

:root[data-theme="dark"] .hero-stats .stat-card {
  background: linear-gradient(180deg, rgba(30, 37, 40, 0.92), rgba(22, 28, 31, 0.84));
  border-color: rgba(173, 185, 182, 0.1);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .hero-stats .stat-label,
:root[data-theme="dark"] .day-tag,
:root[data-theme="dark"] .day-total-label,
:root[data-theme="dark"] .trade-outcomes-caption,
:root[data-theme="dark"] .trade-outcomes-empty,
:root[data-theme="dark"] .trade-outcome-week-insight,
:root[data-theme="dark"] .history-total span,
:root[data-theme="dark"] .metric-score,
:root[data-theme="dark"] .score-help,
:root[data-theme="dark"] .coaching-review-copy,
:root[data-theme="dark"] .coaching-review-list,
:root[data-theme="dark"] .review-note,
:root[data-theme="dark"] .review-note-label {
  color: rgba(197, 190, 179, 0.78);
}

:root[data-theme="dark"] .hero-stats .stat-value span,
:root[data-theme="dark"] .hero-stats .stat-hint,
:root[data-theme="dark"] .hero-stats .stat-hint-score-so-far,
:root[data-theme="dark"] .score-status-pill,
:root[data-theme="dark"] .history-grade,
:root[data-theme="dark"] .review-note-compact-empty {
  color: rgba(183, 175, 164, 0.72);
}

:root[data-theme="dark"] .goal-card {
  background:
    linear-gradient(145deg, rgba(36, 44, 47, 0.88), rgba(23, 29, 32, 0.74));
  border-color: rgba(173, 185, 182, 0.1);
  box-shadow: 0 16px 28px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .stat-card,
:root[data-theme="dark"] .summary-card,
:root[data-theme="dark"] .history-card,
:root[data-theme="dark"] .review-card,
:root[data-theme="dark"] .achievement-chip,
:root[data-theme="dark"] .metric-row {
  background: rgba(29, 36, 39, 0.82);
}

:root[data-theme="dark"] .achievement-tooltip {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(17, 23, 26, 0.98);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

:root[data-theme="dark"] .summary-card-primary {
  background: linear-gradient(145deg, rgba(33, 40, 43, 0.92), rgba(24, 30, 33, 0.88));
}

:root[data-theme="dark"] .summary-metric-list .metric-row,
:root[data-theme="dark"] .review-card .metric-row {
  background: rgba(34, 41, 44, 0.78);
  border-color: rgba(173, 185, 182, 0.08);
}

:root[data-theme="dark"] .score-status-pill {
  border-color: rgba(173, 185, 182, 0.12);
  background: linear-gradient(180deg, rgba(38, 45, 48, 0.82), rgba(31, 37, 40, 0.82));
}

:root[data-theme="dark"] .coaching-review-intro {
  background:
    linear-gradient(180deg, rgba(32, 39, 42, 0.9), rgba(23, 29, 32, 0.88)),
    linear-gradient(90deg, rgba(216, 140, 88, 0.08) 0%, rgba(120, 164, 160, 0.08) 100%);
  border-color: rgba(173, 185, 182, 0.08);
}

:root[data-theme="dark"] .coaching-review-card {
  background:
    linear-gradient(180deg, rgba(30, 37, 40, 0.88), rgba(22, 28, 31, 0.88)),
    linear-gradient(90deg, rgba(216, 140, 88, 0.05) 0%, rgba(120, 164, 160, 0.05) 100%);
  border-color: rgba(173, 185, 182, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .achievement-chip {
  color: rgba(214, 206, 194, 0.88);
  border-color: rgba(173, 185, 182, 0.1);
  background: rgba(31, 38, 41, 0.84);
}

:root[data-theme="dark"] .achievement-chip.is-earned {
  background: linear-gradient(135deg, rgba(91, 82, 50, 0.28), rgba(51, 77, 72, 0.24));
}

:root[data-theme="dark"] .achievement-chip-earned-preview {
  background: linear-gradient(135deg, rgba(36, 43, 46, 0.92), rgba(28, 34, 37, 0.9));
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .achievement-badge {
  background: rgba(255, 255, 255, 0.08);
  color: rgba(214, 206, 194, 0.78);
}

:root[data-theme="dark"] .achievement-chip.is-earned .achievement-badge {
  background: rgba(176, 145, 59, 0.24);
  color: #e4d29a;
}

:root[data-theme="dark"] .day-card {
  background:
    linear-gradient(180deg, rgba(28, 35, 38, 0.94), rgba(19, 24, 27, 0.96));
  border-color: rgba(173, 185, 182, 0.1);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .day-card::after {
  background: radial-gradient(circle, rgba(29, 123, 121, 0.07), transparent 72%);
}

:root[data-theme="dark"] .day-status-badge {
  background: linear-gradient(135deg, rgba(129, 78, 50, 0.4), rgba(96, 52, 35, 0.42));
  border-color: rgba(186, 122, 85, 0.22);
  color: #e1b08f;
}

:root[data-theme="dark"] .day-status-badge.is-event-stand-down {
  background: linear-gradient(135deg, rgba(111, 104, 54, 0.34), rgba(65, 92, 86, 0.34));
  border-color: rgba(111, 148, 141, 0.2);
  color: #bfd4ce;
}

:root[data-theme="dark"] .info-pin {
  border-color: rgba(173, 185, 182, 0.16);
  background: rgba(31, 38, 41, 0.88);
  color: rgba(214, 206, 194, 0.72);
}

:root[data-theme="dark"] .info-pin-wrap:hover .info-pin,
:root[data-theme="dark"] .info-pin-wrap:focus-visible .info-pin,
:root[data-theme="dark"] .info-pin-wrap:focus-within .info-pin {
  border-color: rgba(128, 165, 159, 0.28);
  background: rgba(41, 49, 53, 0.96);
  color: rgba(241, 236, 227, 0.92);
}

:root[data-theme="dark"] .info-tooltip {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(16, 21, 24, 0.98);
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .info-tooltip-title,
:root[data-theme="dark"] .info-tooltip-rule strong {
  color: #f1ece3;
}

:root[data-theme="dark"] .segmented-control {
  background: rgba(255, 255, 255, 0.06);
}

:root[data-theme="dark"] .score-button:hover:not(.is-selected),
:root[data-theme="dark"] .score-button:focus-visible:not(.is-selected) {
  background: linear-gradient(135deg, rgba(58, 65, 68, 0.96) 0%, rgba(44, 52, 55, 0.92) 100%);
  color: #e6e0d7;
  box-shadow:
    inset 0 0 0 1px rgba(173, 185, 182, 0.08),
    0 8px 16px rgba(0, 0, 0, 0.18);
}

:root[data-theme="dark"] .score-button.is-selected {
  box-shadow: 0 10px 18px rgba(122, 67, 38, 0.26);
}

:root[data-theme="dark"] .score-button.is-selected:hover,
:root[data-theme="dark"] .score-button.is-selected:focus-visible {
  box-shadow: 0 8px 16px rgba(101, 56, 32, 0.24);
}

:root[data-theme="dark"] .trade-outcome-add {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(31, 38, 41, 0.78);
}

:root[data-theme="dark"] .trade-outcome-add:hover,
:root[data-theme="dark"] .trade-outcome-add:focus-visible {
  border-color: rgba(128, 165, 159, 0.26);
  background: rgba(40, 48, 52, 0.9);
}

:root[data-theme="dark"] .trade-outcome-chip {
  border-color: rgba(173, 185, 182, 0.1);
  color: #cfc5b8;
  background: rgba(31, 38, 41, 0.76);
}

:root[data-theme="dark"] .trade-outcome-chip-processWin,
:root[data-theme="dark"] .trade-outcome-chip-processLoss,
:root[data-theme="dark"] .trade-outcome-week-item-processWin,
:root[data-theme="dark"] .trade-outcome-week-item-processLoss {
  border-color: rgba(132, 192, 182, 0.24);
  color: #dce8e3;
  background:
    linear-gradient(135deg, rgba(96, 119, 87, 0.38), rgba(55, 94, 88, 0.3)),
    rgba(31, 38, 41, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(223, 246, 240, 0.06),
    0 8px 16px rgba(6, 23, 21, 0.14);
}

:root[data-theme="dark"] .trade-outcome-chip-offPlanWin,
:root[data-theme="dark"] .trade-outcome-chip-offPlanLoss,
:root[data-theme="dark"] .trade-outcome-week-item-offPlanWin,
:root[data-theme="dark"] .trade-outcome-week-item-offPlanLoss {
  border-color: rgba(203, 129, 96, 0.24);
  color: #ebc1a7;
  background:
    linear-gradient(135deg, rgba(134, 82, 60, 0.42), rgba(94, 58, 45, 0.28)),
    rgba(31, 38, 41, 0.76);
  box-shadow:
    inset 0 1px 0 rgba(255, 225, 207, 0.06),
    0 8px 16px rgba(35, 13, 7, 0.16);
}

:root[data-theme="dark"] .trade-outcome-remove {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .trade-outcome-remove:hover {
  background: rgba(168, 84, 52, 0.3);
  color: #efbfaa;
}

:root[data-theme="dark"] .trade-outcome-week-summary {
  background:
    linear-gradient(145deg, rgba(30, 37, 40, 0.82), rgba(22, 28, 31, 0.78));
}

:root[data-theme="dark"] .trade-outcome-week-item {
  border-color: rgba(173, 185, 182, 0.08);
}

:root[data-theme="dark"] .trade-outcome-week-item strong,
:root[data-theme="dark"] .trade-outcome-week-total {
  color: #f1ece3;
}

:root[data-theme="dark"] .day-mode-empty,
:root[data-theme="dark"] .history-empty,
:root[data-theme="dark"] .review-empty {
  border-color: rgba(173, 185, 182, 0.16);
  background: rgba(29, 36, 39, 0.56);
}

:root[data-theme="dark"] .history-grade {
  border: 1px solid rgba(173, 185, 182, 0.1);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 6px 14px rgba(0, 0, 0, 0.16);
}

:root[data-theme="dark"] .summary-grade,
:root[data-theme="dark"] .history-grade {
  color: #f0e8dd;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  backdrop-filter: blur(10px);
  text-shadow: 0 1px 0 rgba(10, 12, 14, 0.28);
}

:root[data-theme="dark"] .summary-grade::before,
:root[data-theme="dark"] .history-grade::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), transparent 46%),
    radial-gradient(circle at top left, rgba(255, 255, 255, 0.08), transparent 56%);
  opacity: 0.8;
  pointer-events: none;
  z-index: -1;
}

:root[data-theme="dark"] .grade-a-plus {
  background:
    linear-gradient(135deg, rgba(55, 134, 130, 0.48), rgba(31, 86, 84, 0.4));
  border-color: rgba(137, 207, 200, 0.28);
  color: #bee7e1;
  box-shadow:
    inset 0 1px 0 rgba(223, 250, 246, 0.12),
    0 0 20px rgba(87, 166, 159, 0.14),
    0 10px 20px rgba(10, 41, 40, 0.18);
}

:root[data-theme="dark"] .grade-good {
  background:
    linear-gradient(135deg, rgba(186, 143, 39, 0.58), rgba(126, 91, 16, 0.46));
  border-color: rgba(230, 190, 87, 0.34);
  color: #f8e2a2;
  box-shadow:
    inset 0 1px 0 rgba(255, 244, 210, 0.14),
    0 0 22px rgba(214, 170, 66, 0.16),
    0 10px 20px rgba(72, 44, 8, 0.18);
}

:root[data-theme="dark"] .grade-attention {
  background:
    linear-gradient(135deg, rgba(166, 88, 47, 0.5), rgba(115, 58, 32, 0.42));
  border-color: rgba(227, 154, 104, 0.28);
  color: #edc09f;
  box-shadow:
    inset 0 1px 0 rgba(255, 231, 216, 0.12),
    0 0 18px rgba(196, 108, 68, 0.14),
    0 10px 20px rgba(55, 24, 11, 0.18);
}

:root[data-theme="dark"] .grade-building {
  background:
    linear-gradient(135deg, rgba(143, 108, 60, 0.42), rgba(96, 70, 40, 0.34));
  border-color: rgba(207, 167, 116, 0.24);
  color: #dec09e;
  box-shadow:
    inset 0 1px 0 rgba(255, 237, 219, 0.1),
    0 0 16px rgba(170, 128, 80, 0.12),
    0 10px 18px rgba(49, 30, 15, 0.16);
}

:root[data-theme="dark"] .grade-in-progress {
  background:
    linear-gradient(135deg, rgba(89, 96, 102, 0.54), rgba(58, 64, 69, 0.42));
  border-color: rgba(190, 201, 198, 0.22);
  color: #e1d7cc;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 0 16px rgba(165, 173, 170, 0.1),
    0 10px 18px rgba(17, 20, 22, 0.18);
}

:root[data-theme="dark"] .review-shift-controls .week-shift-button:disabled:hover {
  background: rgba(29, 36, 39, 0.82);
  border-color: rgba(173, 185, 182, 0.12);
}

:root[data-theme="dark"] .review-density-toggle.is-compact-target:hover,
:root[data-theme="dark"] .review-density-toggle.is-hover-lock-compact {
  border-color: rgba(173, 185, 182, 0.1);
  background: rgba(31, 39, 42, 0.72);
}

:root[data-theme="dark"] .review-density-toggle,
:root[data-theme="dark"] .review-grid.is-compact .review-note-toggle {
  box-shadow: none;
}

:root[data-theme="dark"] .review-grid.is-compact .review-metric-row {
  background: linear-gradient(180deg, rgba(36, 43, 46, 0.82), rgba(27, 33, 36, 0.76));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

:root[data-theme="dark"] .review-grid .review-metric-bar {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .review-grid .review-metric-bar-fill,
:root[data-theme="dark"] .summary-metric-list .metric-bar-fill {
  filter: saturate(0.9) brightness(0.92);
}

:root[data-theme="dark"] .review-grid.is-compact .review-note-popover {
  border-color: rgba(173, 185, 182, 0.12);
  background: rgba(17, 23, 26, 0.985);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.3);
  color: var(--text);
}

:root[data-theme="dark"] .history-list {
  scrollbar-color: rgba(173, 185, 182, 0.22) transparent;
}

:root[data-theme="dark"] .history-list:hover::-webkit-scrollbar-thumb,
:root[data-theme="dark"] .history-list:focus-within::-webkit-scrollbar-thumb {
  background: rgba(173, 185, 182, 0.22);
}

:root[data-theme="dark"] .finish-week-button {
  border-color: rgba(173, 185, 182, 0.12);
  background: linear-gradient(135deg, rgba(38, 45, 48, 0.94), rgba(30, 36, 39, 0.92));
  color: var(--text);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .history-card:hover,
:root[data-theme="dark"] .history-card.is-active {
  background: rgba(35, 43, 46, 0.92);
  box-shadow: 0 16px 26px rgba(0, 0, 0, 0.24);
}

:root[data-theme="dark"] .review-card {
  border-color: rgba(173, 185, 182, 0.1);
  background: rgba(24, 30, 33, 0.98);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
  color: var(--text);
}

.review-grid.is-compact .review-note-popover {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 25;
  width: min(340px, calc(100vw - 64px));
  margin-top: 0;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(101, 73, 46, 0.1);
  background: rgba(255, 251, 246, 0.985);
  box-shadow: 0 18px 34px rgba(79, 40, 17, 0.14);
  color: rgba(72, 56, 42, 0.92);
  font-size: 0.8rem;
  line-height: 1.34;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(6px);
  transition:
    opacity 180ms ease,
    transform 180ms ease,
    visibility 180ms ease;
}

.review-grid.is-compact .review-note-peek.is-popover-up .review-note-popover {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translateY(-6px);
}

.review-grid.is-compact .review-note-peek.is-popover-left .review-note-popover {
  left: auto;
  right: 0;
}

.review-grid.is-compact .review-note-peek:hover .review-note-popover,
.review-grid.is-compact .review-note-peek:focus-within .review-note-popover {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.review-grid.is-compact .review-note:not(.review-note-popover) {
  margin-top: 0;
  padding-top: 0;
  font-size: 0.78rem;
  line-height: 1.28;
}

.review-grid.is-compact .review-note-compact-empty {
  margin-top: 16px;
  font-size: 0.74rem;
  line-height: 1.34;
}

.review-card .metric-list {
  gap: 8px;
  margin-top: 12px;
}

.review-card .metric-row {
  position: relative;
  padding: 9px 11px;
}

.review-card .review-metric-row.is-not-tested {
  padding-right: 58px;
}

.review-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "meta meta"
    "name score";
  gap: 10px;
  align-items: start;
}

.review-day-meta {
  grid-area: meta;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  margin-bottom: 2px;
}

.review-card-header .day-name {
  grid-area: name;
}

.review-card-header .history-total {
  grid-area: score;
}

.review-note-label {
  margin-top: 10px;
}

.review-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.45;
  white-space: pre-wrap;
}

.review-note.is-empty {
  font-style: italic;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "rules days"
      "insights insights";
  }

  .days-grid {
    grid-template-columns: 1fr;
  }

  .summary-metric-list {
    grid-template-columns: 1fr;
  }

  .coaching-review-grid {
    grid-template-columns: 1fr;
  }

  .archive-layout {
    grid-template-columns: 1fr;
  }

  .archive-column {
    height: auto !important;
  }

  .history-list {
    overflow: visible;
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .rules-settings-grid,
  .rules-score-guidance-grid,
  .rules-complete-preview-grid {
    grid-template-columns: 1fr;
  }

  .account-current-card {
    grid-template-columns: 1fr;
    align-items: start;
  }
}

@media (max-width: 920px) {
  .app-header {
    top: 0;
    padding-inline: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }

  .app-brand {
    margin-right: auto;
  }

  .app-nav {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .app-header-actions {
    margin-left: auto;
  }

  .app-shell {
    width: min(100% - 20px, 1400px);
    padding-top: 16px;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .hero-stats,
  .summary-hero,
  .summary-grid,
  .review-grid,
  .coaching-review-grid {
    grid-template-columns: 1fr;
  }

  .summary-lens-tabs {
    width: 100%;
  }

  .review-summary-head {
    display: grid;
  }

  .summary-metric-list {
    width: 100%;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "rules"
      "days"
      "insights";
  }

  .workspace-layout {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 22px;
  }

  .rules-editor-item {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .rules-editor-index,
  .rules-editor-item-actions {
    margin-top: 0;
  }

  .rules-editor-item-actions {
    justify-content: flex-end;
  }

  .days-header {
    display: grid;
    align-items: start;
  }

  .insights-tabs {
    justify-self: end;
  }

  .days-tabs {
    margin-top: 8px;
  }
}

@media (max-width: 640px) {
  .auth-screen {
    align-items: start;
    padding: 18px 12px;
  }

  .auth-card {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .app-header {
    align-items: stretch;
    gap: 6px;
  }

  .rules-editor-footer {
    display: grid;
    justify-items: stretch;
  }

  .rules-editor-head,
  .rules-score-card-head,
  .rules-score-list-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .rules-example-launch {
    width: 100%;
  }

  .rules-example-dialog {
    width: calc(100vw - 12px);
    max-height: calc(100dvh - 12px);
    border-radius: 24px;
  }

  .rules-example-dialog-shell {
    max-height: calc(100dvh - 12px);
  }

  .rules-example-dialog-head {
    padding: 20px 18px 16px;
  }

  .rules-preview-lens-guide {
    grid-template-columns: 1fr;
    padding: 16px 18px 0;
  }

  .rules-complete-preview-grid {
    padding: 16px 18px 20px;
  }

  .rules-preview-score-head,
  .rules-example-dialog-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .rules-example-dialog-footer {
    padding: 14px 18px;
  }

  .rules-example-dialog-footer > div {
    display: grid;
    width: 100%;
  }

  .rules-score-card-actions {
    justify-content: flex-end;
  }

  .account-profile-list-head,
  .account-profile-card,
  .account-security-card {
    align-items: stretch;
    flex-direction: column;
  }

  .account-security-section,
  .account-security-controls,
  .account-password-grid {
    grid-template-columns: 1fr;
  }

  .account-password-grid > .button {
    grid-column: auto;
  }

  .account-profile-list-head .button,
  .account-profile-card .button {
    width: 100%;
  }

  .account-sync-block {
    width: 100%;
    justify-self: stretch;
  }

  .rules-editor-spacer {
    display: none;
  }

  .app-brand {
    padding-inline: 8px;
  }

  .app-brand-copy {
    display: none;
  }

  .app-nav {
    order: 4;
  }

  .app-nav-button,
  .app-mode-button,
  .app-menu-button {
    padding: 8px 10px;
    font-size: 0.68rem;
  }

  .app-header-actions {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  .app-menu-panel {
    right: 0;
    width: min(230px, calc(100vw - 32px));
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero-progress-foot {
    display: grid;
    justify-content: start;
  }

  .hero-actions {
    flex-direction: column;
  }

  .days-tabs {
    grid-auto-flow: row;
    margin-top: 6px;
  }

  .insights-tabs {
    grid-auto-flow: row;
    width: auto;
  }

  .day-nav {
    grid-template-columns: 1fr;
  }

  .day-nav-pills {
    order: -1;
  }

  .button {
    width: 100%;
  }

  .day-header,
  .score-row,
  .history-meta,
  .review-card-header {
    display: grid;
  }

  .hero-panel,
  .day-card,
  .panel {
    border-radius: 24px;
  }

  .segmented-control {
    justify-content: start;
  }
}
