/* =============================================================================
   Al Wakrah Fishing – Mobile-first sea theme
   Decision UI: good (green) / caution (yellow) / bad (red)
   ============================================================================= */

:root {
  --sea-900: #062a3a;
  --sea-800: #0a4d68;
  --sea-700: #0c6b8f;
  --sea-600: #1282a2;
  --sea-500: #1a9bc4;
  --sea-100: #e8f4fc;
  --sand: #fdf8f0;
  --ink: #1a2f3d;
  --muted: #6a8496;
  --card: rgba(255, 255, 255, 0.72);
  --border: rgba(255, 255, 255, 0.45);
  --good: #22a861;
  --good-bg: #e8f8ef;
  --good-soft: #3ecf7a;
  --caution: #e0a000;
  --caution-bg: #fff8e6;
  --caution-soft: #f0c040;
  --bad: #e25545;
  --bad-bg: #fdecea;
  --bad-soft: #f07a6c;
  --shadow:
    0 4px 16px rgba(26, 60, 90, 0.04),
    0 18px 48px rgba(26, 60, 90, 0.08);
  --shadow-lg:
    0 8px 24px rgba(26, 60, 90, 0.06),
    0 28px 64px rgba(26, 60, 90, 0.1);
  --radius: 24px;
  --radius-sm: 18px;
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-strong: rgba(255, 255, 255, 0.82);
  --glass-border: 1px solid rgba(255, 255, 255, 0.5);
  --glass-blur: blur(20px) saturate(1.25);
  --font-ar: "Cairo", "Tajawal", "Segoe UI", Tahoma, sans-serif;
  --font-en: "Inter", system-ui, sans-serif;
  --header-h: 72px;
}

/* Dark mode */
[data-theme="dark"] {
  --sea-900: #031820;
  --sea-800: #083d54;
  --sea-100: #0d2a38;
  --sand: #071820;
  --ink: #e8f2f7;
  --muted: #9bb4c0;
  --card: rgba(12, 36, 48, 0.72);
  --border: rgba(255, 255, 255, 0.1);
  --shadow:
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 18px 48px rgba(0, 0, 0, 0.35);
  --shadow-lg:
    0 8px 24px rgba(0, 0, 0, 0.25),
    0 28px 64px rgba(0, 0, 0, 0.4);
  --glass-bg: rgba(14, 32, 44, 0.72);
  --glass-bg-strong: rgba(18, 40, 54, 0.82);
  --glass-border: 1px solid rgba(255, 255, 255, 0.1);
  --good-bg: #0f2e1c;
  --caution-bg: #2e2610;
  --bad-bg: #2e1412;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body.app-body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ar);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 12% 8%, rgba(255, 236, 210, 0.55), transparent 55%),
    radial-gradient(1000px 600px at 92% 0%, rgba(186, 224, 245, 0.55), transparent 50%),
    linear-gradient(155deg, #FDF8F0 0%, #F5F0E8 38%, #E8F4FC 100%);
  background-attachment: fixed;
}

[data-theme="dark"] body.app-body,
body.app-body[data-theme="dark"] {
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(18, 130, 162, 0.2), transparent 50%),
    linear-gradient(180deg, #04141c 0%, #071820 100%);
}

/* Apply theme on html for body background */
html[data-theme="dark"] body.app-body {
  background:
    radial-gradient(1000px 500px at 80% -10%, rgba(18, 130, 162, 0.2), transparent 50%),
    linear-gradient(180deg, #04141c 0%, #071820 100%);
}

/* ---- Header ---- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(22px) saturate(1.35);
  -webkit-backdrop-filter: blur(22px) saturate(1.35);
  background: rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(255, 255, 255, 0.45);
}

html[data-theme="dark"] .app-header {
  background: rgba(7, 24, 32, 0.85);
}

.brand-icon {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, var(--sea-700), var(--sea-500));
  color: #fff;
  font-size: 1.35rem;
  box-shadow: 0 4px 14px rgba(10, 77, 104, 0.35);
}

.app-title {
  font-size: 1.15rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--sea-900);
}

html[data-theme="dark"] .app-title {
  color: var(--ink);
}

.app-subtitle {
  font-size: 0.78rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.fixed-badge {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--sea-100);
  color: var(--sea-700);
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  margin-inline-start: 0.25rem;
}

html[data-theme="dark"] .fixed-badge {
  background: rgba(26, 155, 196, 0.15);
  color: #7ec8e3;
}

.btn-theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--sea-700);
  display: grid;
  place-items: center;
  padding: 0;
}

.btn-theme-toggle:hover {
  background: var(--sea-100);
}

.btn-lang-toggle {
  font-weight: 800;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  font-family: var(--font-en);
}

.lang-toggle-label {
  line-height: 1;
}

html.lang-en body.app-body {
  font-family: var(--font-en), var(--font-ar), sans-serif;
}

html.lang-en .app-title,
html.lang-en .decision-text,
html.lang-en .section-title {
  font-family: var(--font-en), var(--font-ar), sans-serif;
}

/* ---- Solunar fish activity panel ---- */
.solunar-panel {
  border-radius: calc(var(--radius) + 4px);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  background: var(--card);
}

.solunar-summary {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 0.65rem;
  background: #e8edf0;
  border-bottom: 1px solid var(--border);
}

.solunar-summary-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  justify-content: center;
  text-align: center;
}

.btn-solunar-nav {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  border-radius: 999px;
  border: 1px solid rgba(10, 77, 104, 0.14);
  background: rgba(255, 255, 255, 0.75);
  color: var(--sea-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.btn-solunar-nav i {
  font-size: 1rem;
}

.btn-solunar-nav:hover:not(:disabled),
.btn-solunar-nav:focus-visible {
  background: #fff;
  transform: translateY(-1px);
  outline: none;
}

.btn-solunar-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

html[data-theme="dark"] .btn-solunar-nav {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #d7e8f0;
}

html[data-theme="dark"] .solunar-summary {
  background: rgba(255, 255, 255, 0.06);
}

.solunar-summary.rating-high {
  background: linear-gradient(90deg, rgba(27, 158, 90, 0.16), rgba(232, 246, 251, 0.5));
}
.solunar-summary.rating-medium {
  background: linear-gradient(90deg, rgba(224, 168, 0, 0.16), rgba(232, 246, 251, 0.45));
}
.solunar-summary.rating-low {
  background: linear-gradient(90deg, rgba(192, 57, 43, 0.12), rgba(232, 246, 251, 0.4));
}

html[data-theme="dark"] .solunar-summary.rating-high {
  background: linear-gradient(90deg, rgba(27, 158, 90, 0.22), rgba(255, 255, 255, 0.04));
}
html[data-theme="dark"] .solunar-summary.rating-medium {
  background: linear-gradient(90deg, rgba(224, 168, 0, 0.2), rgba(255, 255, 255, 0.04));
}
html[data-theme="dark"] .solunar-summary.rating-low {
  background: linear-gradient(90deg, rgba(192, 57, 43, 0.2), rgba(255, 255, 255, 0.04));
}

.solunar-fish-row {
  display: inline-flex;
  gap: 0.2rem;
  flex-shrink: 0;
}

.solunar-fish {
  font-size: 1.05rem;
  color: rgba(15, 36, 48, 0.22);
  transform: scaleX(-1);
}

html[data-theme="dark"] .solunar-fish {
  color: rgba(255, 255, 255, 0.22);
}

.solunar-fish.is-on {
  color: var(--sea-800);
}

html[data-theme="dark"] .solunar-fish.is-on {
  color: #cfeaf4;
}

.solunar-summary.rating-high .solunar-fish.is-on { color: var(--good); }
.solunar-summary.rating-medium .solunar-fish.is-on { color: var(--caution); }
.solunar-summary.rating-low .solunar-fish.is-on { color: var(--bad); }

.solunar-summary-text {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.45;
  margin: 0;
}

/* Light theme body (default) */
.solunar-body {
  padding: 1rem 0.95rem 1.05rem;
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(18, 130, 162, 0.08), transparent 55%),
    linear-gradient(180deg, #f7fbfd 0%, #eef6f9 100%);
  color: var(--ink);
}

.solunar-heading {
  font-size: 0.98rem;
  font-weight: 800;
  margin: 0 0 0.85rem;
  color: var(--ink);
}

.solunar-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.solunar-col-title {
  font-size: 0.82rem;
  font-weight: 800;
  margin: 0 0 0.55rem;
  letter-spacing: 0.01em;
}

.solunar-col-major { color: #1b9e5a; }
.solunar-col-minor { color: #c98900; }

.solunar-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.solunar-period {
  border-radius: 14px;
  padding: 0.65rem 0.7rem;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
}

.solunar-period.tone-excellent {
  border-color: rgba(27, 158, 90, 0.35);
  background: rgba(27, 158, 90, 0.1);
}
.solunar-period.tone-good {
  border-color: rgba(45, 179, 110, 0.3);
  background: rgba(45, 179, 110, 0.08);
}
.solunar-period.tone-mid {
  border-color: rgba(224, 168, 0, 0.35);
  background: rgba(224, 168, 0, 0.1);
}
.solunar-period.tone-poor,
.solunar-period.tone-bad {
  border-color: rgba(230, 126, 34, 0.3);
  background: rgba(230, 126, 34, 0.08);
}

.solunar-period-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.solunar-period-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.solunar-period.tone-excellent .solunar-period-icon,
.solunar-period.tone-good .solunar-period-icon {
  color: #1b9e5a;
}

.solunar-period.tone-mid .solunar-period-icon {
  color: #c98900;
}

.solunar-period.tone-poor .solunar-period-icon,
.solunar-period.tone-bad .solunar-period-icon {
  color: #d35400;
}

.solunar-period-activity-text {
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--ink);
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.solunar-period-time-row {
  margin-top: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sea-800);
  font-family: var(--font-en);
}

.solunar-period-top {
  display: none;
}

.solunar-period-dot {
  display: none;
}

.solunar-period-main {
  flex: 1 1 auto;
  min-width: 0;
}

.solunar-period-activity {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--ink);
}

.solunar-period-activity .solunar-fish {
  font-size: 0.85rem;
  color: rgba(15, 36, 48, 0.2);
}

.solunar-period.tone-excellent .solunar-period-activity .solunar-fish.is-on,
.solunar-period.tone-good .solunar-period-activity .solunar-fish.is-on {
  color: #1b9e5a;
}

.solunar-period.tone-mid .solunar-period-activity .solunar-fish.is-on {
  color: #c98900;
}

.solunar-period-time {
  margin-top: 0.2rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sea-800);
  font-family: var(--font-en);
}

.solunar-period-label {
  display: none;
}

.solunar-period-pct {
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 800;
  font-family: var(--font-en);
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  background: rgba(10, 77, 104, 0.08);
  color: var(--sea-800);
}

.solunar-period.tone-excellent .solunar-period-pct,
.solunar-period.tone-good .solunar-period-pct {
  background: rgba(27, 158, 90, 0.16);
  color: #146b3d;
}

.solunar-period.tone-mid .solunar-period-pct {
  background: rgba(224, 168, 0, 0.18);
  color: #8a6200;
}

.solunar-period-note {
  display: none;
  margin: 0.45rem 0 0;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--muted);
  font-family: var(--font-en);
}

.solunar-theory {
  margin-top: 0.85rem !important;
  color: var(--muted) !important;
}

.activity-gauge {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.05rem 0 0.15rem;
  padding: 0.15rem 0 0.1rem;
}

.activity-gauge-ring {
  position: relative;
  width: 168px;
  height: 168px;
}

.activity-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
  filter: drop-shadow(0 10px 18px rgba(196, 138, 34, 0.22));
}

.activity-gauge.is-high .activity-gauge-svg {
  filter: drop-shadow(0 10px 18px rgba(27, 158, 90, 0.22));
}

.activity-gauge.is-low .activity-gauge-svg {
  filter: drop-shadow(0 10px 18px rgba(226, 85, 69, 0.2));
}

.activity-gauge-bg {
  fill: none;
  stroke: #f3ead4;
  stroke-width: 11;
}

.activity-gauge-fg {
  fill: none;
  stroke: url(#activityGold);
  stroke-width: 11;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke-dashoffset 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.activity-gauge.is-high .activity-gauge-fg {
  stroke: url(#activityGood);
}

.activity-gauge.is-low .activity-gauge-fg {
  stroke: url(#activityBad);
}

.activity-gauge-center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.2rem;
  font-weight: 800;
  color: #14202c;
  letter-spacing: -0.04em;
  line-height: 1;
  font-family: 'Inter', 'Cairo', sans-serif;
}

.activity-gauge-ar {
  margin: 0.7rem 0 0;
  font-weight: 800;
  font-size: 1.05rem;
  color: #c48a22;
  text-align: center;
  line-height: 1.35;
}

.activity-gauge-en {
  margin: 0.12rem 0 0;
  font-weight: 700;
  font-size: 0.92rem;
  color: #b07d28;
  text-align: center;
  font-family: 'Inter', sans-serif;
}

.activity-gauge.is-high .activity-gauge-ar,
.activity-gauge.is-high .activity-gauge-en {
  color: #1b9e5a;
}

.activity-gauge.is-low .activity-gauge-ar,
.activity-gauge.is-low .activity-gauge-en {
  color: #c44738;
}

html[data-theme="dark"] .activity-gauge-bg {
  stroke: rgba(255, 236, 200, 0.12);
}

html[data-theme="dark"] .activity-gauge-center {
  color: #eef6fa;
}

html[data-theme="dark"] .activity-gauge-ar {
  color: #e0b24a;
}

html[data-theme="dark"] .activity-gauge-en {
  color: #c9a056;
}

html[data-theme="dark"] .activity-gauge.is-high .activity-gauge-ar,
html[data-theme="dark"] .activity-gauge.is-high .activity-gauge-en {
  color: #5ee09a;
}

html[data-theme="dark"] .activity-gauge.is-low .activity-gauge-ar,
html[data-theme="dark"] .activity-gauge.is-low .activity-gauge-en {
  color: #ff8f80;
}

.solunar-chart-wrap {
  margin-top: 0.75rem;
  height: 170px;
  padding: 0.55rem 0.35rem 0.25rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
}

/* Dark theme overrides for solunar body */
html[data-theme="dark"] .solunar-body {
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(18, 130, 162, 0.1), transparent 55%),
    linear-gradient(180deg, #0d2a38 0%, #0b1f2a 100%);
  color: #e8f2f7;
}

html[data-theme="dark"] .solunar-heading {
  color: #fff;
}

html[data-theme="dark"] .solunar-col-major { color: #7ddea8; }
html[data-theme="dark"] .solunar-col-minor { color: #f0d78a; }

html[data-theme="dark"] .solunar-period {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .solunar-period.tone-excellent {
  border-color: rgba(27, 158, 90, 0.45);
  background: rgba(27, 158, 90, 0.12);
}
html[data-theme="dark"] .solunar-period.tone-good {
  border-color: rgba(45, 179, 110, 0.4);
  background: rgba(45, 179, 110, 0.1);
}
html[data-theme="dark"] .solunar-period.tone-mid {
  border-color: rgba(224, 168, 0, 0.4);
  background: rgba(224, 168, 0, 0.1);
}

html[data-theme="dark"] .solunar-period-dot {
  border-color: rgba(255, 255, 255, 0.25);
}

html[data-theme="dark"] .solunar-period-activity {
  color: #fff;
}

html[data-theme="dark"] .solunar-period-activity .solunar-fish {
  color: rgba(255, 255, 255, 0.2);
}

html[data-theme="dark"] .solunar-period.tone-excellent .solunar-period-activity .solunar-fish.is-on,
html[data-theme="dark"] .solunar-period.tone-good .solunar-period-activity .solunar-fish.is-on {
  color: #7ddea8;
}

html[data-theme="dark"] .solunar-period.tone-mid .solunar-period-activity .solunar-fish.is-on {
  color: #f0d78a;
}

html[data-theme="dark"] .solunar-period-time {
  color: rgba(232, 242, 247, 0.85);
}

html[data-theme="dark"] .solunar-period-label {
  color: rgba(232, 242, 247, 0.62);
}

html[data-theme="dark"] .solunar-period-pct {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

html[data-theme="dark"] .solunar-period.tone-excellent .solunar-period-pct,
html[data-theme="dark"] .solunar-period.tone-good .solunar-period-pct {
  background: rgba(27, 158, 90, 0.3);
  color: #b8f0d0;
}

html[data-theme="dark"] .solunar-period.tone-mid .solunar-period-pct {
  background: rgba(224, 168, 0, 0.28);
  color: #ffe9a8;
}

html[data-theme="dark"] .solunar-period-note {
  color: rgba(232, 242, 247, 0.58);
}

html[data-theme="dark"] .solunar-theory {
  color: rgba(232, 242, 247, 0.5) !important;
}

html[data-theme="dark"] .solunar-chart-wrap {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.06);
}

/* ---- Decision card (hero) – Premium Glassmorphism ---- */
.decision-card {
  background: var(--glass-bg);
  border-radius: 28px;
  box-shadow: var(--shadow-lg);
  border: var(--glass-border);
  padding: 0.85rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  transition: transform 0.28s ease, box-shadow 0.28s ease, border-color 0.25s ease;
}

.decision-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: linear-gradient(90deg, rgba(18, 130, 162, 0.55), rgba(26, 155, 196, 0.35));
  z-index: 3;
}

.decision-card.rec-good::before {
  background: linear-gradient(90deg, var(--good), var(--good-soft));
}
.decision-card.rec-caution::before {
  background: linear-gradient(90deg, var(--caution), var(--caution-soft));
}
.decision-card.rec-bad::before {
  background: linear-gradient(90deg, var(--bad), var(--bad-soft));
}

.decision-card.rec-good {
  box-shadow:
    0 8px 24px rgba(34, 168, 97, 0.08),
    0 28px 64px rgba(26, 60, 90, 0.08);
}
.decision-card.rec-caution {
  box-shadow:
    0 8px 24px rgba(224, 160, 0, 0.08),
    0 28px 64px rgba(26, 60, 90, 0.08);
}
.decision-card.rec-bad {
  box-shadow:
    0 8px 24px rgba(226, 85, 69, 0.08),
    0 28px 64px rgba(26, 60, 90, 0.08);
}

html[data-theme="dark"] .decision-card {
  background: var(--glass-bg);
  border: var(--glass-border);
}

.decision-card > * {
  position: relative;
  z-index: 2;
}

/* Soft glass panels */
.decision-panel {
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 22px;
  box-shadow:
    0 6px 20px rgba(26, 60, 90, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

html[data-theme="dark"] .decision-panel {
  background: rgba(14, 32, 44, 0.55);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28);
}



.decision-panel-head {
  padding: 0.55rem 0.5rem 0.5rem;
  background: rgba(255, 255, 255, 0.35);
}

.decision-panel-score {
  padding: 0.75rem 0.7rem 0.7rem;
  position: relative;
}

html[data-theme="dark"] .decision-panel-head {
  background: rgba(255, 255, 255, 0.03);
}

.header-rail {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  width: 100%;
}

.header-rail > .btn-day-nav {
  flex: 0 0 auto;
  align-self: center;
}

.header-main {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0.55rem;
  flex: 1 1 auto;
  min-width: 0;
}

.decision-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  margin-bottom: 0.4rem;
  padding-inline: 0.1rem;
}

.decision-day-badge,
.lunar-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.22rem 0.7rem;
  line-height: 1.2;
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 12px rgba(26, 60, 90, 0.05);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.decision-day-badge {
  color: #8a5a12;
  background: linear-gradient(145deg, rgba(255, 244, 214, 0.95), rgba(255, 232, 168, 0.85));
}

.decision-day-badge i {
  font-size: 0.72rem;
  color: #c98900;
}

.lunar-phase-badge.is-hamal {
  color: #0a6e7a;
  background: linear-gradient(145deg, rgba(223, 247, 244, 0.95), rgba(190, 236, 228, 0.88));
}

.lunar-phase-badge.is-fasad {
  color: #8a5a12;
  background: linear-gradient(145deg, rgba(255, 240, 216, 0.95), rgba(255, 224, 176, 0.88));
}

html[data-theme="dark"] .decision-day-badge {
  color: #f0d78a;
  background: rgba(201, 137, 0, 0.22);
  border-color: rgba(240, 197, 106, 0.25);
}

html[data-theme="dark"] .lunar-phase-badge.is-hamal {
  color: #7fd4e0;
  background: rgba(18, 130, 162, 0.25);
  border-color: rgba(127, 212, 224, 0.25);
}

html[data-theme="dark"] .lunar-phase-badge.is-fasad {
  color: #f0c56a;
  background: rgba(201, 137, 0, 0.2);
  border-color: rgba(240, 197, 106, 0.25);
}

.lunar-phase-badge i {
  font-size: 0.72rem;
  line-height: 1;
}

/* Compact calendar leaves */
.cal-leaf {
  flex: 0 1 6.2rem;
  width: 6.2rem;
  max-width: 6.6rem;
  display: flex;
  flex-direction: column;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow:
    0 6px 16px rgba(26, 60, 90, 0.07),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cal-leaf:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(26, 60, 90, 0.1);
}

html[data-theme="dark"] .cal-leaf {
  background: rgba(20, 34, 46, 0.75);
  border-color: rgba(255, 255, 255, 0.08);
}

.cal-leaf-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.28rem 0.3rem;
  line-height: 1.1;
}

.cal-leaf-g .cal-leaf-head {
  background: linear-gradient(180deg, #f6b0ad 0%, #ef8b86 100%);
}

.cal-leaf-h .cal-leaf-head {
  background: linear-gradient(180deg, #9ad6e4 0%, #74c3d6 100%);
}

.cal-leaf-head-icon {
  color: rgba(255, 255, 255, 0.95);
  font-size: 0.68rem;
  line-height: 1;
}

.cal-leaf-month {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.cal-leaf-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  padding: 0.3rem 0.25rem 0.2rem;
  flex: 1;
}

.cal-leaf-day {
  font-family: var(--font-en);
  font-size: 1.55rem;
  font-weight: 800;
  color: #1a3550;
  line-height: 0.95;
  letter-spacing: -0.03em;
}

html[data-theme="dark"] .cal-leaf-day { color: #f2f6f9; }

.cal-leaf-weekday {
  font-size: 0.6rem;
  font-weight: 700;
  color: #5f7588;
  line-height: 1.15;
}

.cal-leaf-year {
  font-family: var(--font-en);
  font-size: 0.62rem;
  font-weight: 700;
  color: #7a8f9e;
  line-height: 1.15;
  margin-top: 0.12rem;
  padding-top: 0.2rem;
  width: 72%;
  border-top: 1px solid rgba(20, 40, 60, 0.08);
}

html[data-theme="dark"] .cal-leaf-weekday { color: #a8bbc8; }
html[data-theme="dark"] .cal-leaf-year {
  color: #9bb0bd;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.cal-leaf-foot {
  display: flex;
  justify-content: center;
  padding: 0 0.3rem 0.35rem;
  background: transparent;
  border: 0;
}

.cal-leaf-pill {
  display: inline-block;
  font-size: 0.55rem;
  font-weight: 800;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  line-height: 1.15;
}

.cal-leaf-g .cal-leaf-pill {
  color: #b84a45;
  background: rgba(239, 133, 128, 0.22);
}

.cal-leaf-h .cal-leaf-pill {
  color: #2a7f96;
  background: rgba(110, 191, 212, 0.25);
}

.btn-day-nav {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.7);
  color: #4d6b7c;
  border-radius: 50%;
  padding: 0;
  box-shadow: 0 4px 12px rgba(26, 60, 90, 0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-day-nav:hover:not(:disabled),
.btn-day-nav:focus-visible {
  background: rgba(255, 255, 255, 0.92);
  color: var(--sea-800);
  transform: translateY(-1px);
  outline: none;
}

.btn-day-nav:active:not(:disabled) { transform: scale(0.96); }
.btn-day-nav:disabled { opacity: 0.35; cursor: not-allowed; }

html[data-theme="dark"] .btn-day-nav {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.1);
  color: #b7cbd6;
}

.btn-day-nav i { font-size: 1rem; line-height: 1; }

.day-nav-hint {
  text-align: center;
  font-size: 0.62rem;
  color: #6a8496;
  font-weight: 600;
  margin: 0.35rem 0 0;
  min-height: 1em;
}

html[data-theme="dark"] .day-nav-hint { color: #b7cbd6; }

/* Score + Moon split inside decision panel */
.score-moon-split {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem 1rem;
  width: 100%;
  margin: 0.15rem 0 0.55rem;
}

.score-moon-col-score {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.score-moon-sep {
  flex: 0 0 auto;
  width: 1px;
  align-self: stretch;
  min-height: 7.5rem;
  margin: 0.35rem 0;
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(18, 100, 130, 0.28) 16%,
    rgba(18, 100, 130, 0.28) 84%,
    transparent 100%
  );
}

html[data-theme="dark"] .score-moon-sep {
  background: linear-gradient(
    180deg,
    transparent 0%,
    rgba(180, 210, 230, 0.28) 16%,
    rgba(180, 210, 230, 0.28) 84%,
    transparent 100%
  );
}

.score-moon-split.is-moon-hidden .score-moon-sep,
.score-moon-split.is-moon-hidden .moon-phase-card {
  display: none;
}

.score-moon-split.is-moon-hidden .score-moon-col-score {
  flex: 1 1 auto;
}

.moon-phase-card {
  flex: 1 1 0;
  min-width: 0;
  max-width: 11.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  margin: 0;
  padding: 0.55rem 0.6rem 0.5rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 8px 20px rgba(26, 60, 90, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  text-align: center;
}

html[data-theme="dark"] .moon-phase-card {
  background: rgba(20, 42, 58, 0.55);
  border-color: rgba(160, 200, 255, 0.12);
}

.moon-phase-orb-wrap {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 28%, #355a78 0%, #0b1724 72%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.15rem;
  box-shadow:
    0 6px 14px rgba(8, 24, 42, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.moon-phase-svg {
  width: 42px;
  height: 42px;
  display: block;
  overflow: visible;
}

.moon-sky { fill: transparent; }
.moon-face { stroke: rgba(255, 255, 255, 0.55); stroke-width: 1; }
.moon-shadow-disc {
  fill: rgba(6, 14, 26, 0.9);
  pointer-events: none;
  transition: cx 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.moon-phase-name {
  font-size: 0.82rem;
  font-weight: 800;
  color: #1a3550;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0;
}

html[data-theme="dark"] .moon-phase-name { color: #f0f5f8; }

.moon-phase-illum {
  font-size: 0.66rem;
  font-weight: 700;
  color: #6a8496;
  margin: 0 0 0.25rem;
}

html[data-theme="dark"] .moon-phase-illum { color: #9ec6d6; }

.moon-phase-times-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.moon-phase-time-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  width: 100%;
  font-size: 0.6rem;
  font-weight: 700;
  color: #3d5a6c;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  padding: 0.24rem 0.4rem;
  line-height: 1.15;
}

.moon-phase-time-item i {
  color: #e0a000;
  font-size: 0.74rem;
  line-height: 1;
}

html[data-theme="dark"] .moon-phase-time-item {
  color: #b7d0dc;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
}

@media (min-width: 480px) {
  .cal-leaf {
    flex-basis: 6.6rem;
    width: 6.6rem;
    max-width: 7rem;
  }
  .cal-leaf-day { font-size: 1.7rem; }
  .moon-phase-card { max-width: 12.5rem; }
  .moon-phase-orb-wrap { width: 58px; height: 58px; }
  .moon-phase-svg { width: 48px; height: 48px; }
  .score-moon-split { gap: 1rem 1.25rem; }
}

@media (max-width: 520px) {
  .score-moon-split {
    flex-direction: column;
    gap: 0.65rem;
  }
  .score-moon-sep {
    width: min(70%, 12rem);
    height: 1px;
    min-height: 0;
    margin: 0;
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(18, 100, 130, 0.28) 18%,
      rgba(18, 100, 130, 0.28) 82%,
      transparent 100%
    );
  }
  html[data-theme="dark"] .score-moon-sep {
    background: linear-gradient(
      90deg,
      transparent 0%,
      rgba(180, 210, 230, 0.28) 18%,
      rgba(180, 210, 230, 0.28) 82%,
      transparent 100%
    );
  }
  .moon-phase-card {
    max-width: 16rem;
    width: 100%;
  }
}

.score-ring-wrap {
  display: flex;
  justify-content: center;
  margin: 0 0 0.15rem;
}

.score-ring {
  position: relative;
  width: 118px;
  height: 118px;
}

.score-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.score-bg {
  fill: none;
  stroke: rgba(10, 77, 104, 0.1);
  stroke-width: 10;
}

html[data-theme="dark"] .score-bg {
  stroke: rgba(255, 255, 255, 0.08);
}

.score-fg {
  fill: none;
  stroke: var(--sea-600);
  stroke-width: 10;
  stroke-linecap: round;
  stroke-dasharray: 326.73;
  stroke-dashoffset: 326.73;
  transition: stroke 0.3s ease;
}

.rec-good .score-fg { stroke: var(--good); }
.rec-caution .score-fg { stroke: var(--caution); }
.rec-bad .score-fg { stroke: var(--bad); }

.score-center {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  direction: ltr;
  unicode-bidi: isolate;
}

.score-number {
  font-size: 2.05rem;
  font-weight: 800;
  font-family: var(--font-en);
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.02em;
}

.decision-text {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0.2rem 0 0.05rem;
  letter-spacing: -0.02em;
  text-align: center;
}

.rec-good .decision-text { color: var(--good); }
.rec-caution .decision-text { color: var(--caution); }
.rec-bad .decision-text { color: var(--bad); }

.decision-text-en {
  font-family: var(--font-en);
  font-size: 0.78rem;
  font-weight: 700;
  color: #2a4554;
  margin: 0;
  text-align: center;
}

html[data-theme="dark"] .decision-text-en {
  color: #c5d8e2;
}

.decision-notes-hint {
  margin: 0.15rem 0 0.45rem;
  text-align: center;
  font-size: 0.68rem;
  font-weight: 500;
  color: rgba(10, 77, 104, 0.55);
}

html[data-theme="dark"] .decision-notes-hint {
  color: rgba(197, 216, 226, 0.55);
}

.decision-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
  margin: 0;
  min-height: 0;
}

@media (min-width: 420px) {
  .decision-notes {
    grid-template-columns: repeat(auto-fill, minmax(7.6rem, 1fr));
  }
}

.decision-notes li {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.55rem 0.45rem 0.5rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--ink);
  border: 1px solid rgba(10, 77, 104, 0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  user-select: none;
  transition: opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  text-align: center;
  min-height: 4.6rem;
}

.decision-notes li .note-text {
  line-height: 1.35;
  font-weight: 600;
  font-size: 0.7rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.decision-notes li .note-pct {
  flex-shrink: 0;
  font-size: 0.82rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-en), sans-serif;
  min-width: 2.7rem;
  text-align: center;
  padding: 0.28rem 0.4rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.35);
  line-height: 1;
}

/* Green → red by factor quality % */
.decision-notes li.tone-excellent {
  background: rgba(27, 158, 90, 0.16);
  border-color: rgba(27, 158, 90, 0.32);
  color: #146b3d;
}
.decision-notes li.tone-excellent .note-pct {
  background: rgba(27, 158, 90, 0.22);
  color: #0f5a33;
  border-color: rgba(27, 158, 90, 0.28);
}

.decision-notes li.tone-good {
  background: rgba(45, 179, 110, 0.14);
  border-color: rgba(45, 179, 110, 0.28);
  color: #1a7a48;
}
.decision-notes li.tone-good .note-pct {
  background: rgba(45, 179, 110, 0.2);
  color: #176640;
  border-color: rgba(45, 179, 110, 0.25);
}

.decision-notes li.tone-mid {
  background: rgba(224, 168, 0, 0.16);
  border-color: rgba(201, 137, 0, 0.3);
  color: #8a6200;
}
.decision-notes li.tone-mid .note-pct {
  background: rgba(224, 168, 0, 0.22);
  color: #7a5600;
  border-color: rgba(201, 137, 0, 0.28);
}

.decision-notes li.tone-poor {
  background: rgba(230, 126, 34, 0.15);
  border-color: rgba(211, 84, 0, 0.28);
  color: #a34a0a;
}
.decision-notes li.tone-poor .note-pct {
  background: rgba(230, 126, 34, 0.2);
  color: #8f4008;
  border-color: rgba(211, 84, 0, 0.25);
}

.decision-notes li.tone-bad {
  background: rgba(231, 76, 60, 0.14);
  border-color: rgba(192, 57, 43, 0.3);
  color: #a93226;
}
.decision-notes li.tone-bad .note-pct {
  background: rgba(231, 76, 60, 0.2);
  color: #922b21;
  border-color: rgba(192, 57, 43, 0.28);
}

.decision-notes li.tone-danger {
  background: rgba(192, 57, 43, 0.18);
  border-color: rgba(146, 43, 33, 0.38);
  color: #7b241c;
}
.decision-notes li.tone-danger .note-pct {
  background: rgba(192, 57, 43, 0.28);
  color: #641e16;
  border-color: rgba(146, 43, 33, 0.35);
}

.decision-notes li:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 42, 58, 0.08);
}

.decision-notes li:focus-visible {
  outline: 2px solid rgba(14, 116, 144, 0.45);
  outline-offset: 2px;
}

.decision-notes li.is-ignored {
  opacity: 0.48;
  filter: grayscale(0.55);
  text-decoration: none;
  border-style: dashed;
}

.decision-notes li.is-ignored .note-text {
  text-decoration: line-through;
}

.decision-notes li .note-off-badge {
  font-size: 0.6rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.12rem 0.35rem;
  border-radius: 6px;
  background: rgba(100, 116, 139, 0.22);
  color: #475569;
}

.decision-notes li.note-hint {
  cursor: default;
  opacity: 0.7;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.45);
  color: var(--muted);
  grid-column: 1 / -1;
  min-height: 0;
  justify-content: center;
}

html[data-theme="dark"] .decision-notes li.tone-excellent {
  background: rgba(27, 158, 90, 0.22);
  color: #8ee0b0;
}
html[data-theme="dark"] .decision-notes li.tone-good {
  background: rgba(45, 179, 110, 0.2);
  color: #9ad9b5;
}
html[data-theme="dark"] .decision-notes li.tone-mid {
  background: rgba(224, 168, 0, 0.2);
  color: #f0d78a;
}
html[data-theme="dark"] .decision-notes li.tone-poor {
  background: rgba(230, 126, 34, 0.2);
  color: #f0b27a;
}
html[data-theme="dark"] .decision-notes li.tone-bad,
html[data-theme="dark"] .decision-notes li.tone-danger {
  background: rgba(231, 76, 60, 0.22);
  color: #f5b7b1;
}

html[data-theme="dark"] .decision-notes li .note-pct {
  background: rgba(0, 0, 0, 0.22);
  border-color: rgba(255, 255, 255, 0.08);
  color: inherit;
}

html[data-theme="dark"] .decision-notes li.is-ignored {
  background: rgba(255, 255, 255, 0.04);
}

html[data-theme="dark"] .decision-notes li .note-off-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}


.decision-metrics {
  margin: 0;
  --bs-gutter-x: 0.65rem;
  --bs-gutter-y: 0.65rem;
}

.decision-metrics > [class*="col-"] {
  display: flex;
}

.metric-chip {
  --metric-accent: var(--sea-600);
  flex: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.metric-chip:hover {
  transform: translateY(-3px);
}

.metric-chip::before,
.metric-chip::after {
  content: none;
  display: none;
}

.metric-chip > * { position: relative; z-index: 1; }

/* Widget look lives in dash.css (#decisionCard .metric-chip) */

/* ---- Section titles ---- */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--sea-900);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

html[data-theme="dark"] .section-title {
  color: var(--ink);
}

.section-title i {
  color: var(--sea-600);
}

/* ---- 3-hourly marine table ---- */
.marine-slots-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 1rem 0.85rem 0.95rem;
}

.slots-intro {
  margin-top: -0.15rem;
}

.slots-day-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.slots-date-badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--sea-800);
  background: rgba(18, 130, 162, 0.1);
  border: 1px solid rgba(18, 130, 162, 0.2);
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  white-space: nowrap;
  min-width: 9.5rem;
  text-align: center;
}

.btn-slots-nav {
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid rgba(18, 130, 162, 0.22);
  background: rgba(255, 255, 255, 0.75);
  color: var(--sea-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease, opacity 0.15s ease;
}

.btn-slots-nav i {
  font-size: 0.95rem;
}

.btn-slots-nav:hover:not(:disabled),
.btn-slots-nav:focus-visible {
  background: #fff;
  transform: translateY(-1px);
  outline: none;
}

.btn-slots-nav:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

html[data-theme="dark"] .slots-date-badge {
  color: var(--ink);
  background: rgba(18, 130, 162, 0.18);
}

html[data-theme="dark"] .btn-slots-nav {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #d7e8f0;
}

.marine-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 12px;
  border: 1px solid var(--border);
}

.marine-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--card);
}

.marine-table thead th {
  background: rgba(10, 77, 104, 0.08);
  color: var(--sea-900);
  font-weight: 700;
  text-align: center;
  padding: 0.65rem 0.45rem;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

html[data-theme="dark"] .marine-table thead th {
  background: rgba(18, 130, 162, 0.16);
  color: var(--ink);
}

.marine-table tbody td {
  text-align: center;
  padding: 0.6rem 0.4rem;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  vertical-align: middle;
}

.marine-table tbody tr:nth-child(even) {
  background: rgba(10, 77, 104, 0.03);
}

html[data-theme="dark"] .marine-table tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

.marine-table tbody tr:last-child td {
  border-bottom: none;
}

.slot-hour {
  font-family: var(--font-en);
  font-weight: 700;
  color: var(--sea-800);
}

html[data-theme="dark"] .slot-hour {
  color: var(--sea-500);
}

.warn-pill {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
}

.warn-pill.warn-none {
  color: var(--muted);
  background: rgba(90, 115, 128, 0.1);
}

.warn-pill.warn-caution {
  color: #8a5a00;
  background: var(--caution-bg);
}

.warn-pill.warn-danger {
  color: #8e1e14;
  background: var(--bad-bg);
}

html[data-theme="dark"] .warn-pill.warn-caution {
  color: var(--caution-soft);
}

html[data-theme="dark"] .warn-pill.warn-danger {
  color: #ff8a7a;
}

.weather-cell {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  white-space: nowrap;
}

.weather-cell i {
  color: var(--sea-600);
  font-size: 1.05rem;
}

.weather-icon-img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 auto;
}

.wave-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.25;
}

.wave-ft {
  font-weight: 700;
}

.wave-m {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-en);
}

.col-wind,
.col-current {
  white-space: nowrap;
  font-size: 0.78rem;
}

.tiny {
  font-size: 0.72rem;
}

/* ---- Wave / wind trend chart ---- */
.marine-chart-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 1rem 0.85rem 0.85rem;
}

.chart-legend-inline {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem 1rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

.chart-legend-inline .leg-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.chart-legend-inline .leg-item i {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
}

.chart-legend-inline .leg-wave i {
  background: var(--sea-600);
}

.chart-legend-inline .leg-wind i {
  background: #c98900;
}

.chart-canvas-wrap {
  position: relative;
  width: 100%;
  height: 196px;
}

/* ---- Detail stats ---- */
#detailGrid,
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0.75rem 0.7rem;
  height: 100%;
  box-shadow: 0 2px 10px rgba(6, 42, 58, 0.04);
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
  text-align: inherit;
  width: 100%;
  display: block;
  color: inherit;
  font: inherit;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 4px;
  background: rgba(18, 130, 162, 0.28);
}

.stat-card.rec-good {
  background: linear-gradient(180deg, var(--good-bg) 0%, var(--card) 48%);
}
.stat-card.rec-caution {
  background: linear-gradient(180deg, var(--caution-bg) 0%, var(--card) 48%);
}
.stat-card.rec-bad {
  background: linear-gradient(180deg, var(--bad-bg) 0%, var(--card) 48%);
}

.stat-card.rec-good::before {
  background: linear-gradient(90deg, var(--good), var(--good-soft));
}
.stat-card.rec-caution::before {
  background: linear-gradient(90deg, var(--caution), var(--caution-soft));
}
.stat-card.rec-bad::before {
  background: linear-gradient(90deg, var(--bad), var(--bad-soft));
}

.stat-card:hover,
.stat-card:focus-visible {
  border-color: var(--sea-600);
  box-shadow: 0 0 0 2px rgba(18, 130, 162, 0.18);
  outline: none;
  transform: translateY(-1px);
}

.stat-card.is-selected {
  border-color: var(--sea-600);
  box-shadow: 0 0 0 2px rgba(18, 130, 162, 0.28);
}

.stat-card.is-selected.rec-good {
  background: linear-gradient(180deg, var(--good-bg) 0%, rgba(18, 130, 162, 0.06) 55%);
}
.stat-card.is-selected.rec-caution {
  background: linear-gradient(180deg, var(--caution-bg) 0%, rgba(18, 130, 162, 0.06) 55%);
}
.stat-card.is-selected.rec-bad {
  background: linear-gradient(180deg, var(--bad-bg) 0%, rgba(18, 130, 162, 0.06) 55%);
}

html[data-theme="dark"] .stat-card.is-selected.rec-good {
  background: linear-gradient(180deg, var(--good-bg) 0%, rgba(18, 130, 162, 0.14) 60%);
}
html[data-theme="dark"] .stat-card.is-selected.rec-caution {
  background: linear-gradient(180deg, var(--caution-bg) 0%, rgba(18, 130, 162, 0.14) 60%);
}
html[data-theme="dark"] .stat-card.is-selected.rec-bad {
  background: linear-gradient(180deg, var(--bad-bg) 0%, rgba(18, 130, 162, 0.14) 60%);
}

.stat-card-hint {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65rem;
  color: var(--sea-600);
  font-weight: 600;
}

.stat-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.4rem;
  margin-bottom: 0.35rem;
}

.stat-mood {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  line-height: 1;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--border);
}

.stat-card.rec-good .stat-mood {
  color: var(--good);
  background: rgba(27, 158, 90, 0.12);
  border-color: rgba(27, 158, 90, 0.22);
}
.stat-card.rec-caution .stat-mood {
  color: var(--caution);
  background: rgba(201, 137, 0, 0.12);
  border-color: rgba(201, 137, 0, 0.22);
}
.stat-card.rec-bad .stat-mood {
  color: var(--bad);
  background: rgba(192, 57, 43, 0.12);
  border-color: rgba(192, 57, 43, 0.22);
}

html[data-theme="dark"] .stat-mood {
  background: rgba(0, 0, 0, 0.25);
}

.detail-trend-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 1rem 0.85rem 0.85rem;
}

.btn-close-trend {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.btn-close-trend:hover,
.btn-close-trend:focus-visible {
  color: var(--ink);
  border-color: var(--sea-600);
  outline: none;
}

.stat-card .stat-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: rgba(18, 130, 162, 0.12);
  color: var(--sea-700);
  font-size: 0.95rem;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.stat-card .stat-label {
  font-size: 0.72rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

.stat-card .stat-value {
  font-family: var(--font-en);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.25;
}

.stat-card .stat-sub {
  font-size: 0.7rem;
  color: var(--muted);
  font-family: var(--font-en);
}

/* ---- 7-day horizontal scroll ---- */
.days-scroll {
  display: flex;
  gap: 0.7rem;
  overflow-x: auto;
  padding: 0.35rem 0.15rem 0.85rem;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

.days-scroll::-webkit-scrollbar {
  height: 5px;
}
.days-scroll::-webkit-scrollbar-thumb {
  background: rgba(10, 77, 104, 0.25);
  border-radius: 99px;
}

.day-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 0.85rem 0.7rem;
  text-align: center;
  box-shadow: 0 4px 14px rgba(6, 42, 58, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  overflow: hidden;
}

.day-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--sea-500);
}

.day-card.rec-good::before { background: var(--good); }
.day-card.rec-caution::before { background: var(--caution); }
.day-card.rec-bad::before { background: var(--bad); }

.day-card:hover,
.day-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  outline: none;
}

.day-card.is-active {
  border-color: var(--sea-600);
  box-shadow: 0 0 0 2px rgba(18, 130, 162, 0.25);
}

.day-card.is-today {
  border-color: rgba(18, 130, 162, 0.45);
}

.day-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  line-height: 1.3;
}

.day-date {
  font-size: 0.7rem;
  color: var(--muted);
  margin-bottom: 0.45rem;
  font-family: var(--font-en);
}

.day-score {
  font-family: var(--font-en);
  font-size: 1.55rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.15rem;
}

.day-card.rec-good .day-score { color: var(--good); }
.day-card.rec-caution .day-score { color: var(--caution); }
.day-card.rec-bad .day-score { color: var(--bad); }

.day-rec {
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 0.55rem;
  min-height: 2em;
  line-height: 1.25;
}

.day-card.rec-good .day-rec { color: var(--good); }
.day-card.rec-caution .day-rec { color: var(--caution); }
.day-card.rec-bad .day-rec { color: var(--bad); }

.day-meta {
  font-size: 0.72rem;
  color: var(--muted);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-family: var(--font-en);
}

.day-meta span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
}

/* ---- Skeleton ---- */
.skeleton {
  background: linear-gradient(90deg, rgba(10, 77, 104, 0.08) 25%, rgba(10, 77, 104, 0.14) 50%, rgba(10, 77, 104, 0.08) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite linear;
  border-radius: 8px;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.skeleton-card {
  min-height: 320px;
  padding: 1.5rem;
}

.skeleton-line {
  height: 14px;
}
.skeleton-line.w-30 { width: 30%; }
.skeleton-line.w-40 { width: 40%; }
.skeleton-line.w-60 { width: 60%; }
.skeleton-line.w-80 { width: 80%; }

.skeleton-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
}

.day-card-skeleton {
  flex: 0 0 140px;
  height: 170px;
  border-radius: 16px;
}

/* ---- Empty / error ---- */
.empty-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.btn-retry {
  background: var(--sea-700);
  border-color: var(--sea-700);
  border-radius: 12px;
  font-weight: 700;
}

.btn-retry:hover {
  background: var(--sea-800);
  border-color: var(--sea-800);
}

/* ---- Footer ---- */
.app-footer {
  padding-bottom: calc(1.5rem + env(safe-area-inset-bottom, 0px));
}

.tiny {
  font-size: 0.7rem;
  line-height: 1.5;
}

/* ---- Hamal / Fasad lunar calendar (forecast window) ---- */
.lunar-calendar-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 2px);
  box-shadow: var(--shadow);
  padding: 1rem 0.85rem 1rem;
}

.lunar-calendar-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
}

.lunar-calendar-titles {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.lunar-calendar-titles .section-title {
  font-size: 0.95rem;
  margin: 0;
  min-width: 0;
}

.lunar-calendar-hint {
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--muted);
}

.lunar-cal-switch {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  cursor: pointer;
  user-select: none;
  margin: 0;
}

.lunar-cal-switch-text {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  min-width: 2.6rem;
  text-align: center;
}

.lunar-cal-switch input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.lunar-cal-switch-ui {
  position: relative;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: #c5d0d6;
  transition: background 0.2s ease;
  display: inline-block;
  flex-shrink: 0;
}

.lunar-cal-switch-thumb {
  position: absolute;
  top: 3px;
  inset-inline-start: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: inset-inline-start 0.2s ease, inset-inline-end 0.2s ease;
}

.lunar-cal-switch input:checked + .lunar-cal-switch-ui {
  background: #2e7d4f;
}

.lunar-cal-switch input:checked + .lunar-cal-switch-ui .lunar-cal-switch-thumb {
  inset-inline-start: auto;
  inset-inline-end: 3px;
}

.lunar-cal-switch input:focus-visible + .lunar-cal-switch-ui {
  outline: 2px solid var(--sea-600);
  outline-offset: 2px;
}

.lunar-cal-switch:has(input:checked) .lunar-cal-switch-text {
  color: #2e7d4f;
}

.lunar-day-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.5rem;
  direction: rtl;
  margin-top: 0.85rem;
}

.lunar-day-cell {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 16px;
  padding: 0.55rem 0.28rem 0.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.18rem;
  cursor: pointer;
  font: inherit;
  color: inherit;
  min-height: 5.4rem;
  min-width: 0;
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
}

.lunar-day-cell.is-hamal {
  background: #f6e27a;
  color: #5c4a08;
  border-color: rgba(180, 140, 20, 0.35);
}

.lunar-day-cell.is-fasad {
  background: #8fd39a;
  color: #145223;
  border-color: rgba(40, 120, 60, 0.3);
}

html[data-theme="dark"] .lunar-day-cell.is-hamal {
  background: #c9ad2e;
  color: #1f1804;
}

html[data-theme="dark"] .lunar-day-cell.is-fasad {
  background: #3f9a55;
  color: #07150b;
}

.lunar-day-cell:hover,
.lunar-day-cell:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(6, 42, 58, 0.12);
  outline: none;
}

.lunar-day-cell.is-selected {
  box-shadow: 0 0 0 2px var(--sea-700), 0 4px 14px rgba(6, 42, 58, 0.14);
  border-color: var(--sea-700);
}

.lunar-day-cell.is-today .lunar-day-num {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.lunar-day-num {
  font-size: 1.28rem;
  font-weight: 800;
  line-height: 1.1;
  font-family: var(--font-ar);
}

.lunar-day-phase {
  font-size: 0.72rem;
  font-weight: 800;
  opacity: 0.92;
  line-height: 1.2;
}

.lunar-day-g {
  font-size: 0.62rem;
  font-weight: 700;
  opacity: 0.78;
  font-family: var(--font-ar), sans-serif;
  direction: inherit;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.2;
}

.lunar-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin-top: 0.9rem;
}

.lunar-leg {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
  font-size: 0.68rem;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.35;
  padding: 0.45rem 0.5rem;
  border-radius: 12px;
  background: rgba(18, 130, 162, 0.06);
}

.lunar-leg::before {
  content: "";
  width: 1.35rem;
  height: 0.7rem;
  border-radius: 4px;
  display: inline-block;
}

.lunar-leg-hamal::before {
  background: #f6e27a;
  border: 1px solid rgba(180, 140, 20, 0.4);
}

.lunar-leg-fasad::before {
  background: #8fd39a;
  border: 1px solid rgba(40, 120, 60, 0.35);
}

/* ---- Warning ---- */
#warningBanner {
  border-radius: 12px;
  font-size: 0.85rem;
}

/* ---- Desktop polish ---- */
@media (min-width: 768px) {
  main.container-fluid {
    max-width: 720px;
    margin-inline: auto;
  }

  .app-title {
    font-size: 1.35rem;
  }

  .decision-text {
    font-size: 1.75rem;
  }

  .day-card {
    flex: 0 0 148px;
  }
}

@media (min-width: 992px) {
  main.container-fluid {
    max-width: 860px;
  }

  .days-scroll {
    flex-wrap: wrap;
    overflow: visible;
  }

  .day-card {
    flex: 1 1 calc(14.28% - 0.7rem);
    min-width: 110px;
  }

  .hint-scroll {
    display: none !important;
  }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  .score-fg,
  .day-card,
  .skeleton {
    transition: none !important;
    animation: none !important;
  }
}

/* Score breakdown button + bottom sheet */
.btn-score-breakdown {
  position: absolute;
  top: 0.55rem;
  left: 0.55rem;
  z-index: 2;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  border: 1px solid rgba(10, 77, 104, 0.14);
  background: rgba(255, 255, 255, 0.78);
  color: var(--sea-800);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.12rem;
  line-height: 1;
  box-shadow: 0 4px 14px rgba(6, 42, 58, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.btn-score-breakdown:hover {
  transform: translateY(-1px);
  background: #fff;
  color: var(--sea-700);
}

.btn-score-breakdown:focus-visible {
  outline: 2px solid rgba(14, 116, 144, 0.45);
  outline-offset: 2px;
}

html[data-theme="dark"] .btn-score-breakdown {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.12);
  color: #d7e8f0;
}

.score-sheet-modal.modal {
  --bs-modal-margin: 0;
}

.score-sheet-modal .modal-dialog-bottom {
  margin: 0 auto;
  width: 100%;
  max-width: 520px;
  height: auto;
  display: flex;
  align-items: flex-end;
  min-height: calc(100% - 0rem);
}

.score-sheet-modal.modal.fade .modal-dialog-bottom {
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.score-sheet-modal.modal.show .modal-dialog-bottom {
  transform: translateY(0);
}

.score-breakdown-modal {
  border: none;
  border-radius: 28px 28px 0 0;
  background: #fff;
  color: #0b1f2a;
  box-shadow: 0 -12px 40px rgba(6, 42, 58, 0.18);
  max-height: min(92vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0.35rem 1.15rem calc(0.85rem + env(safe-area-inset-bottom, 0px));
}

html[data-theme="dark"] .score-breakdown-modal {
  background: #0c2430;
  color: var(--ink);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.45);
}

.score-sheet-handle {
  width: 44px;
  height: 5px;
  border-radius: 999px;
  background: rgba(15, 36, 48, 0.14);
  margin: 0.35rem auto 0.85rem;
  flex-shrink: 0;
}

html[data-theme="dark"] .score-sheet-handle {
  background: rgba(255, 255, 255, 0.18);
}

.score-sheet-header {
  text-align: center;
  margin-bottom: 0.85rem;
  flex-shrink: 0;
}

.score-sheet-title {
  margin: 0;
  font-size: 1.28rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0b1f2a;
}

html[data-theme="dark"] .score-sheet-title {
  color: var(--ink);
}

.score-sheet-sub {
  margin: 0.3rem 0 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #5a7380;
}

.score-sheet-summary {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  border-radius: 18px;
  background: linear-gradient(145deg, #f3fafc 0%, #e8f4f8 100%);
  border: 1px solid rgba(18, 130, 162, 0.12);
  margin-bottom: 0.7rem;
  flex-shrink: 0;
}

html[data-theme="dark"] .score-sheet-summary {
  background: rgba(18, 130, 162, 0.12);
  border-color: rgba(255, 255, 255, 0.08);
}

.score-sheet-summary-score {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 4.4rem;
  padding: 0.35rem 0.55rem;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(6, 42, 58, 0.06);
}

html[data-theme="dark"] .score-sheet-summary-score {
  background: rgba(255, 255, 255, 0.06);
}

.score-sheet-summary-value {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--sea-700);
  font-variant-numeric: tabular-nums;
}

.score-sheet-summary-label {
  font-size: 0.68rem;
  font-weight: 700;
  color: #5a7380;
}

.score-sheet-summary-meta {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.score-sheet-summary-meta > span:first-child {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0b1f2a;
}

html[data-theme="dark"] .score-sheet-summary-meta > span:first-child {
  color: var(--ink);
}

.score-sheet-summary-weights {
  font-size: 0.76rem;
  font-weight: 600;
  color: #5a7380;
}

.score-sheet-formula {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 0.74rem;
  font-weight: 700;
  color: #6b8490;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.score-sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
  padding-bottom: 0.35rem;
  margin: 0 -0.15rem;
  padding-inline: 0.15rem;
}

.score-factor-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.score-factor-empty {
  text-align: center;
  padding: 1.5rem 0.75rem;
  color: #5a7380;
  font-weight: 600;
  font-size: 0.88rem;
}

.score-factor-card {
  border: 1px solid rgba(10, 77, 104, 0.08);
  border-radius: 16px;
  background: #fbfcfd;
  padding: 0.75rem 0.8rem 0.7rem;
  transition: opacity 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

html[data-theme="dark"] .score-factor-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

.score-factor-card.is-ignored {
  opacity: 0.55;
  background: rgba(148, 163, 184, 0.08);
  border-style: dashed;
}

.score-factor-top {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.score-factor-rank {
  flex-shrink: 0;
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--sea-800);
  background: rgba(18, 130, 162, 0.12);
}

.score-factor-main {
  flex: 1 1 auto;
  min-width: 0;
}

.score-factor-name {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 800;
  color: #0b1f2a;
  line-height: 1.25;
}

html[data-theme="dark"] .score-factor-name {
  color: var(--ink);
}

.score-factor-card.is-ignored .score-factor-name {
  text-decoration: line-through;
}

.score-factor-note {
  margin: 0.12rem 0 0;
  font-size: 0.74rem;
  font-weight: 600;
  color: #5a7380;
  line-height: 1.4;
}

.score-factor-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  margin-bottom: 0.55rem;
}

.score-factor-metric {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.score-factor-metric-lbl {
  font-size: 0.66rem;
  font-weight: 700;
  color: #7a919c;
}

.score-factor-metric-val {
  font-size: 0.78rem;
  font-weight: 800;
  color: #0b1f2a;
  font-variant-numeric: tabular-nums;
}

html[data-theme="dark"] .score-factor-metric-val {
  color: var(--ink);
}

.score-factor-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(10, 77, 104, 0.08);
  overflow: hidden;
}

html[data-theme="dark"] .score-factor-bar {
  background: rgba(255, 255, 255, 0.08);
}

.score-factor-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sea-600), var(--sea-500));
}

.score-factor-bar > span.fill-excellent,
.score-factor-bar > span.fill-good {
  background: linear-gradient(90deg, #1b9e5a, #2db36e);
}

.score-factor-bar > span.fill-mid {
  background: linear-gradient(90deg, #c98900, #e0a800);
}

.score-factor-bar > span.fill-bad {
  background: linear-gradient(90deg, #c0392b, #e74c3c);
}

.score-factor-bar > span.fill-unknown {
  background: #94a3b8;
}

.score-grade-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.14rem 0.48rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
  width: fit-content;
  max-width: 100%;
}

.score-grade-pill .grade-dot {
  width: 0.42rem;
  height: 0.42rem;
}

.grade-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  background: #94a3b8;
}

.grade-excellent { background: var(--good); }
.grade-good { background: var(--good-soft); }
.grade-mid { background: var(--caution-soft); }
.grade-bad { background: var(--bad); }
.grade-off { background: #94a3b8; }

.score-grade-pill.grade-excellent,
.score-grade-pill.grade-good {
  background: var(--good-bg);
  color: var(--good);
  border-color: rgba(27, 158, 90, 0.18);
}

.score-grade-pill.grade-mid {
  background: var(--caution-bg);
  color: var(--caution);
  border-color: rgba(201, 137, 0, 0.18);
}

.score-grade-pill.grade-bad {
  background: var(--bad-bg);
  color: var(--bad);
  border-color: rgba(192, 57, 43, 0.16);
}

.score-grade-pill.grade-unknown {
  background: rgba(148, 163, 184, 0.15);
  color: var(--muted);
}

.btn-factor-toggle {
  flex-shrink: 0;
  border: 1px solid rgba(10, 77, 104, 0.12);
  background: #fff;
  color: #0b1f2a;
  font-size: 0.68rem;
  font-weight: 800;
  border-radius: 999px;
  padding: 0.28rem 0.55rem;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
}

.btn-factor-toggle .bi {
  font-size: 0.78rem;
}

.btn-factor-toggle.is-off {
  background: rgba(148, 163, 184, 0.16);
  color: #64748b;
  border-style: dashed;
}

html[data-theme="dark"] .btn-factor-toggle {
  background: rgba(255, 255, 255, 0.06);
  color: #d7e8f0;
  border-color: rgba(255, 255, 255, 0.1);
}

.score-sheet-footer {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding-top: 0.85rem;
  margin-top: 0.25rem;
  border-top: 1px solid rgba(10, 77, 104, 0.06);
}

html[data-theme="dark"] .score-sheet-footer {
  border-top-color: rgba(255, 255, 255, 0.06);
}

.score-sheet-reset {
  border: none;
  background: transparent;
  color: var(--sea-700);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 0.25rem 0.5rem;
}

.score-sheet-reset:hover {
  color: var(--sea-800);
  text-decoration: underline;
}

.score-sheet-cancel {
  border: none;
  background: transparent;
  color: #6b8490;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.45rem 1rem;
  min-width: 6rem;
}

.score-sheet-cancel:hover {
  color: #0b1f2a;
}

html[data-theme="dark"] .score-sheet-cancel {
  color: #9bb4c0;
}

html[data-theme="dark"] .score-sheet-cancel:hover {
  color: #e8f2f7;
}

@media (min-width: 576px) {
  .score-sheet-modal .modal-dialog-bottom {
    align-items: center;
    min-height: calc(100% - 1.75rem);
    margin: 1.75rem auto;
  }

  .score-sheet-modal.modal.fade .modal-dialog-bottom {
    transform: translateY(1.25rem) scale(0.98);
    opacity: 0;
    transition: transform 0.28s ease, opacity 0.28s ease;
  }

  .score-sheet-modal.modal.show .modal-dialog-bottom {
    transform: none;
    opacity: 1;
  }

  .score-breakdown-modal {
    border-radius: 24px;
    max-height: min(88vh, 780px);
    padding-bottom: 1rem;
  }

  .score-sheet-handle {
    display: none;
  }
}
