:root {
  --bg: #020916;
  --panel: rgba(3, 18, 38, 0.9);
  --panel-strong: rgba(4, 25, 54, 0.96);
  --ink: #eef7ff;
  --muted: #7f9fbd;
  --line: rgba(0, 174, 255, 0.34);
  --navy: #061a33;
  --blue: #19b7ff;
  --cyan: #51e5ff;
  --green: #15d991;
  --yellow: #f3a724;
  --red: #ff4f64;
  --red-soft: rgba(255, 79, 100, 0.14);
  --input: rgba(255, 245, 188, 0.92);
  --soft: rgba(7, 30, 60, 0.76);
}

* {
  box-sizing: border-box;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.item-icon svg,
.snapshot-icon svg,
.evidence-icon svg {
  width: 62%;
  height: 62%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 7px color-mix(in srgb, currentColor 54%, transparent));
}

body {
  margin: 0;
  min-width: 1180px;
  background:
    radial-gradient(circle at 50% 20%, rgba(36, 171, 255, 0.19), transparent 24%),
    radial-gradient(circle at 14% 8%, rgba(0, 174, 255, 0.12), transparent 22%),
    radial-gradient(circle at 88% 4%, rgba(0, 92, 180, 0.16), transparent 24%),
    linear-gradient(180deg, #020814 0%, #031327 48%, #020814 100%);
  color: var(--ink);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  font-size: 14px;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(50, 185, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 185, 255, 0.045) 1px, transparent 1px),
    linear-gradient(115deg, transparent 0 47%, rgba(81, 229, 255, 0.06) 48%, transparent 50% 100%);
  background-size: 48px 48px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 72%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(0, 143, 255, 0.18), rgba(0, 80, 150, 0.16));
  color: white;
  cursor: pointer;
  min-height: 38px;
  padding: 0 14px;
  box-shadow: 0 0 0 1px rgba(81, 229, 255, 0.18) inset;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid rgba(0, 174, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 247, 210, 0.92);
  color: #172033;
  padding: 8px 9px;
}

textarea {
  resize: vertical;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

.app-shell {
  width: min(1500px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.topbar {
  height: 36px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0, 174, 255, 0.18);
  background: linear-gradient(90deg, rgba(0, 174, 255, 0.08), transparent 38%, rgba(0, 174, 255, 0.04));
}

h1 {
  color: #9fb8cf;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: 0;
  text-shadow: 0 0 10px rgba(81, 229, 255, 0.24);
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.footer-admin {
  margin-top: 18px;
  text-align: right;
}

.footer-admin button {
  min-height: 0;
  background: transparent;
  color: rgba(127, 159, 189, 0.58);
  padding: 0;
  font-size: 12px;
  text-decoration: underline;
}

.mobile-history-entry,
.mobile-history-home {
  display: none;
}

.command-grid {
  display: grid;
  grid-template-columns: 440px minmax(360px, 1fr) 460px;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
}

.score-hero,
.conclusion-card,
.panel,
.data-section {
  border: 1px solid var(--line);
  border-radius: 4px;
  background:
    linear-gradient(180deg, rgba(7, 31, 65, 0.56), rgba(2, 13, 30, 0.78)),
    var(--panel);
  box-shadow:
    0 0 0 1px rgba(0, 77, 128, 0.2) inset,
    0 0 28px rgba(0, 153, 255, 0.12),
    0 18px 38px rgba(0, 0, 0, 0.24);
  position: relative;
  overflow: hidden;
}

.score-hero::before,
.conclusion-card::before,
.panel::before,
.data-section::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(81, 229, 255, 0.2), transparent 18%) top left / 90px 90px no-repeat,
    linear-gradient(315deg, rgba(81, 229, 255, 0.22), transparent 18%) bottom right / 90px 90px no-repeat;
  opacity: 0.42;
}

.score-hero::before,
.conclusion-card::before,
.panel::before {
  border-top: 1px solid rgba(81, 229, 255, 0.18);
}

.score-hero {
  --score-hud-shift-y: -56px;
  min-height: 330px;
  padding: 38px;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--ink);
  display: grid;
  grid-template-rows: 1fr auto auto 1fr;
  place-items: center;
  text-align: center;
  isolation: isolate;
  overflow: visible;
  cursor: help;
}

.score-hero::after {
  content: "";
  position: absolute;
  width: 425px;
  height: 425px;
  border-radius: 50%;
  background: url("./assets/score-hud-ring-v1.png") center / contain no-repeat;
  box-shadow: none;
  z-index: 0;
  opacity: 0.96;
  transform: translateY(var(--score-hud-shift-y));
}

#homePage .conclusion-card,
#homePage .panel {
  border: 1px solid rgba(25, 183, 255, 0.26);
  border-radius: 6px;
  clip-path: none;
  background:
    linear-gradient(180deg, rgba(6, 29, 61, 0.66), rgba(2, 13, 30, 0.82)),
    rgba(3, 18, 38, 0.86);
  box-shadow:
    0 0 0 1px rgba(81, 229, 255, 0.08) inset,
    0 16px 34px rgba(0, 0, 0, 0.22);
  padding: 24px;
}

#homePage .conclusion-panel,
#homePage > .panel {
  background-image:
    linear-gradient(180deg, rgba(6, 29, 61, 0.66), rgba(2, 13, 30, 0.82));
}

#homePage .conclusion-card::before,
#homePage .panel::before,
#homePage .conclusion-card::after,
#homePage .panel::after {
  display: none;
}

#homePage .conclusion-card > *,
#homePage .panel > * {
  position: relative;
  z-index: 1;
}

#homePage .panel-title {
  margin: 0 10px 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(81, 229, 255, 0.28);
}

#homePage .command-grid .conclusion-card > .panel-title,
#homePage .command-grid .snapshot-panel > .panel-title {
  display: none;
}

#homePage .conclusion-head,
#homePage .summary-list,
#homePage .snapshot-grid,
#homePage #autoConclusion,
#homePage .evidence-list {
  margin: 0 10px;
}

.score-hero > span,
.score-hero small,
.score-breakdown {
  color: #b7d8ef;
  z-index: 1;
}

.score-hero > span {
  display: none;
}

.score-hero strong {
  font-size: 86px;
  line-height: 0.95;
  letter-spacing: 0;
  margin: 0;
  color: #f4f8ff;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3), 0 0 44px rgba(25, 183, 255, 0.42);
  z-index: 1;
}

.score-hero small {
  display: none;
}

.score-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 12px;
  font-size: 14px;
  color: #8fb1cf;
}

.score-breakdown span {
  display: inline-flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  min-width: 230px;
  margin: 0;
  font-size: 14px;
  color: #b7d8ef;
}

.score-breakdown b {
  min-width: 36px;
  margin-left: 0;
  color: #f4f8ff;
  font-size: 18px;
  text-align: right;
}

.score-breakdown b.positive {
  color: #56f0a4;
}

.score-breakdown b.negative {
  color: #ffbf40;
}

.score-tooltip {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: min(360px, calc(100% - 28px));
  transform: translate(-50%, 10px);
  border: 1px solid rgba(81, 229, 255, 0.32);
  border-radius: 6px;
  background: rgba(3, 18, 38, 0.94);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28), 0 0 24px rgba(25, 183, 255, 0.14);
  color: #cfe3f7;
  font-size: 13px;
  line-height: 1.65;
  padding: 12px 14px;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 4;
}

.score-hero:hover .score-tooltip,
.score-hero.tooltip-visible .score-tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.conclusion-card {
  min-height: 330px;
  padding: 18px;
  display: grid;
  gap: 12px;
  align-content: start;
}

.conclusion-head {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.conclusion-head div {
  min-height: 78px;
  border: 1px solid rgba(0, 174, 255, 0.34);
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(8, 37, 74, 0.8), rgba(3, 18, 38, 0.72));
  padding: 13px 16px;
  display: grid;
  grid-template-columns: 58px 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 14px;
}

.conclusion-head span,
.panel-title span,
.section-title span {
  color: var(--muted);
  font-size: 12px;
}

.conclusion-head strong {
  font-size: 28px;
  color: #f5fbff;
  text-shadow: 0 0 15px rgba(25, 183, 255, 0.24);
}

.item-icon {
  width: 46px;
  height: 46px;
  grid-row: 1 / 3;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  border: 1px solid rgba(81, 229, 255, 0.12);
  background: rgba(25, 183, 255, 0.1);
  color: #58caff;
  box-shadow: 0 0 18px rgba(25, 183, 255, 0.1), inset 0 0 16px rgba(25, 183, 255, 0.08);
}

.item-icon.mood,
.item-icon.strategy {
  color: #4fa7ff;
  background: rgba(49, 114, 255, 0.13);
}

.item-icon.shield {
  color: #6997ff;
  background: rgba(64, 103, 255, 0.13);
}

.item-icon.flag,
.item-icon.note {
  color: #4fa7ff;
}

.item-icon.target {
  color: #8a67ff;
  background: rgba(138, 103, 255, 0.12);
}

.item-icon.core {
  color: #a06bff;
  background: rgba(138, 66, 255, 0.13);
}

.item-icon.risk {
  color: #f3a724;
  background: rgba(243, 167, 36, 0.12);
}

.item-icon.pulse {
  color: #15d991;
  background: rgba(21, 217, 145, 0.12);
}

#autoConclusion {
  border: 1px solid rgba(0, 174, 255, 0.28);
  background: rgba(4, 24, 50, 0.72);
  border-radius: 6px;
  min-height: 136px;
  padding: 20px;
  line-height: 1.85;
  color: #cfe3f7;
}

.home-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  padding: 18px;
}

.panel-title,
.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panel-title h2,
.section-title h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.panel-title h2::before,
.section-title h2::before {
  content: "";
  width: 4px;
  height: 18px;
  border-radius: 1px;
  background: linear-gradient(180deg, #76f3ff, #0d90ff);
  box-shadow: 0 0 12px rgba(81, 229, 255, 0.78);
}

.panel-title h2,
.section-title h2 {
  font-size: 18px;
  color: #f1f8ff;
  text-shadow: 0 0 14px rgba(81, 229, 255, 0.2);
}

.ghost-button {
  min-height: 30px;
  background: rgba(0, 143, 255, 0.12);
  color: var(--ink);
}

.summary-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.summary-list div {
  border: 1px solid rgba(0, 174, 255, 0.28);
  border-radius: 6px;
  background: rgba(5, 24, 50, 0.76);
  padding: 13px 14px;
  display: grid;
  grid-template-columns: 46px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
}

.summary-list dt,
.snapshot-grid span {
  color: var(--muted);
  font-size: 12px;
}

.summary-list dd,
.snapshot-grid strong {
  display: block;
  margin-top: 7px;
  color: #f4fbff;
  font-weight: 700;
  line-height: 1.35;
}

.snapshot-grid {
  display: grid;
  grid-template-columns: 1fr;
  align-content: stretch;
  height: 100%;
  border: 1px solid rgba(0, 174, 255, 0.18);
  border-radius: 6px;
  background:
    linear-gradient(180deg, rgba(7, 31, 65, 0.52), rgba(2, 13, 30, 0.62)),
    rgba(5, 24, 50, 0.6);
  overflow: hidden;
}

.snapshot-primary {
  display: grid;
}

.snapshot-row {
  min-height: 72px;
  border-bottom: 1px solid rgba(81, 229, 255, 0.16);
  display: grid;
  grid-template-columns: 54px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
}

.snapshot-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-style: normal;
  box-shadow: 0 0 22px rgba(0, 0, 0, 0.18) inset;
}

.snapshot-icon.up {
  background: rgba(255, 79, 100, 0.16);
  color: #ff5668;
}

.snapshot-icon.warn {
  background: rgba(243, 167, 36, 0.14);
  color: #f3a724;
}

.snapshot-icon.good {
  background: rgba(21, 217, 145, 0.13);
  color: #15d991;
}

.snapshot-row span {
  font-size: 18px;
  color: #d8e8f7;
  font-weight: 700;
}

.snapshot-row strong {
  color: #f4fbff;
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.snapshot-row.limit-up strong {
  color: #ff6678;
  text-shadow: 0 0 18px rgba(255, 79, 100, 0.32);
}

.snapshot-row.broken strong {
  color: #ffc45c;
  text-shadow: 0 0 18px rgba(243, 167, 36, 0.3);
}

.snapshot-row.limit-down strong {
  color: #38e59d;
  text-shadow: 0 0 18px rgba(21, 217, 145, 0.3);
}

.snapshot-secondary {
  min-height: 126px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid rgba(81, 229, 255, 0.22);
}

.snapshot-secondary div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 14px;
  padding: 18px 10px;
  position: relative;
}

.snapshot-secondary div + div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 28px;
  bottom: 28px;
  width: 1px;
  background: rgba(81, 229, 255, 0.22);
}

.snapshot-secondary span {
  font-size: 16px;
  color: #b4c9dc;
  font-weight: 700;
}

.snapshot-secondary strong {
  color: #f4fbff;
  font-size: 28px;
  line-height: 1;
  text-shadow: 0 0 18px rgba(255, 255, 255, 0.18);
}

.evidence-list {
  display: grid;
  gap: 6px;
}

.evidence-item {
  border: 1px solid rgba(0, 174, 255, 0.26);
  border-radius: 6px;
  overflow: hidden;
  background: rgba(6, 28, 57, 0.74);
}

.evidence-button {
  width: 100%;
  min-height: 54px;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  display: grid;
  grid-template-columns: 40px 1fr auto auto 24px;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  text-align: left;
}

.evidence-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #58caff;
  background: rgba(25, 183, 255, 0.1);
  border: 1px solid rgba(81, 229, 255, 0.14);
}

.evidence-toggle {
  color: #a7c4dd;
  text-align: center;
}

.evidence-name {
  font-weight: 700;
  color: #f4fbff;
}

.evidence-score {
  font-size: 18px;
  font-weight: 800;
  color: #f4fbff;
}

.state {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
}

.state.good {
  background: rgba(21, 217, 145, 0.13);
  color: var(--green);
  border: 1px solid rgba(21, 217, 145, 0.35);
}

.state.mid {
  background: rgba(25, 183, 255, 0.13);
  color: var(--blue);
  border: 1px solid rgba(25, 183, 255, 0.35);
}

.state.warn {
  background: rgba(243, 167, 36, 0.13);
  color: var(--yellow);
  border: 1px solid rgba(243, 167, 36, 0.35);
}

.state.bad {
  background: var(--red-soft);
  color: var(--red);
  border: 1px solid rgba(255, 79, 100, 0.36);
}

.evidence-detail {
  display: none;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding: 12px 12px 14px 66px;
  align-items: stretch;
}

.evidence-item.open .evidence-detail {
  display: grid;
}

.evidence-detail div {
  min-height: 60px;
  border: 1px solid rgba(0, 174, 255, 0.22);
  border-radius: 6px;
  background: rgba(2, 15, 32, 0.76);
  padding: 10px 14px;
  color: var(--muted);
  line-height: 1.4;
  display: flex;
  align-items: center;
}

.detail-label {
  color: #7f9fbd;
}

.detail-value {
  color: #f4fbff;
  font-weight: 700;
}

.admin-layout {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 14px;
  align-items: start;
}

.admin-sidebar {
  display: grid;
  gap: 12px;
}

.admin-main {
  display: grid;
  gap: 14px;
}

.form-row {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.form-row label {
  font-size: 12px;
  color: var(--muted);
}

.rule-list,
.source-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.rule-list li,
.source-list li {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 8px;
  line-height: 1.35;
  background: var(--soft);
}

.rule-list li.triggered {
  border-color: #f2b8a2;
  background: var(--red-soft);
  color: #7c2d12;
}

.data-section {
  overflow: hidden;
}

.section-title {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  margin: 0;
}

.table-wrap {
  overflow: auto;
}

.table-wrap.compact {
  max-height: 460px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  background: var(--bg);
  color: var(--navy);
  font-size: 12px;
}

.sort-button {
  min-height: 0;
  border-radius: 0;
  background: transparent;
  color: var(--navy);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  font-size: 12px;
  font-weight: 700;
}

.sort-button span {
  display: inline-block;
  width: 10px;
  color: var(--muted);
}

.tag-select {
  min-width: 118px;
  padding: 6px 8px;
}

.adjust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px;
}

.adjust-grid label {
  display: grid;
  gap: 6px;
}

.adjust-grid span {
  color: var(--muted);
  font-size: 12px;
}

#adminPage {
  color: #172033;
  background: #f5f7fb;
  border: 1px solid #d9e2ef;
  border-radius: 10px;
  padding: 16px;
}

#adminPage .panel,
#adminPage .data-section {
  border: 1px solid #d9e2ef;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
}

#adminPage .table-wrap {
  background: #ffffff;
}

#adminPage .panel::before,
#adminPage .data-section::before {
  display: none;
}

#adminPage .panel-title,
#adminPage .section-title {
  border-bottom: 1px solid #e5edf6;
}

#adminPage .panel-title h2,
#adminPage .section-title h2 {
  color: #172033;
  text-shadow: none;
}

#adminPage .panel-title h2::before,
#adminPage .section-title h2::before {
  background: #2563eb;
  box-shadow: none;
}

#adminPage .panel-title span,
#adminPage .section-title span,
#adminPage .form-row label,
#adminPage .adjust-grid span {
  color: #64748b;
}

#adminPage input,
#adminPage select,
#adminPage textarea {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #172033;
  box-shadow: none;
}

#adminPage select {
  appearance: none;
  padding-right: 46px;
  background-image: url("data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%23172033' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 18px center;
  background-size: 18px 18px;
}

#adminPage input:focus,
#adminPage select:focus,
#adminPage textarea:focus {
  outline: 2px solid rgba(37, 99, 235, 0.18);
  border-color: #2563eb;
}

#adminPage button {
  background: #2563eb;
  color: #ffffff;
  box-shadow: none;
}

#adminPage .sort-button {
  background: transparent;
  color: #334155;
}

#adminPage .sort-button span {
  color: #64748b;
}

#adminPage .rule-list li,
#adminPage .source-list li {
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  color: #334155;
}

#adminPage .rule-list li.triggered {
  border-color: #fed7aa;
  background: #fff7ed;
  color: #9a3412;
}

#adminPage th,
#adminPage td {
  border-bottom: 1px solid #e5edf6;
  color: #172033;
}

#adminPage th {
  background: #f1f5f9;
  color: #475569;
}

#adminPage tr:hover td {
  background: #f8fafc;
}

.admin-login-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 9, 22, 0.72);
  backdrop-filter: blur(6px);
}

.admin-login-modal.open {
  display: flex;
}

.admin-login-card {
  width: 360px;
  border-radius: 10px;
  background: #ffffff;
  color: #172033;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.admin-login-card h2 {
  margin-bottom: 18px;
  font-size: 20px;
}

.admin-login-card label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.admin-login-card span {
  color: #64748b;
  font-size: 13px;
}

.admin-login-card input {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #172033;
}

.admin-login-error {
  min-height: 20px;
  color: #dc2626;
  font-size: 13px;
}

.admin-login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.admin-login-actions button:first-child {
  background: #e2e8f0;
  color: #334155;
}

.admin-login-actions button:last-child {
  background: #2563eb;
  color: #ffffff;
}


.history-shell {
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 22px 24px 28px;
  border: 1px solid rgba(0, 174, 255, 0.22);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(6, 26, 51, 0.92), rgba(2, 10, 23, 0.96)),
    radial-gradient(circle at 50% 0%, rgba(81, 229, 255, 0.16), transparent 44%);
  box-shadow: inset 0 0 28px rgba(25, 183, 255, 0.08), 0 18px 60px rgba(0, 0, 0, 0.22);
}

.history-topbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 10px;
}

.history-back {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(127, 159, 189, 0.74);
  font-size: 13px;
  text-decoration: underline;
}

.history-back:hover {
  color: var(--cyan);
}

.history-toolbar {
  display: grid;
  grid-template-columns: 56px 1fr 56px;
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.history-nav,
.history-month {
  border: 1px solid rgba(81, 229, 255, 0.24);
  background: rgba(3, 18, 38, 0.72);
  color: var(--ink);
  box-shadow: inset 0 0 18px rgba(25, 183, 255, 0.08);
}

.history-nav {
  width: 56px;
  height: 48px;
  padding: 0;
  border-radius: 8px;
  font-size: 36px;
  line-height: 1;
}

.history-month {
  height: 58px;
  justify-content: center;
  border-radius: 8px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 0;
}

.history-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin-bottom: 10px;
  color: rgba(238, 247, 255, 0.68);
  font-size: 18px;
  text-align: center;
}

.history-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  grid-auto-rows: 118px;
  border: 1px solid rgba(0, 174, 255, 0.22);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(2, 9, 22, 0.58);
}

.history-day {
  position: relative;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  padding: 12px 8px;
  border: 0;
  border-right: 1px solid rgba(0, 174, 255, 0.18);
  border-bottom: 1px solid rgba(0, 174, 255, 0.18);
  border-radius: 0;
  background: rgba(4, 25, 54, 0.42);
  color: rgba(238, 247, 255, 0.86);
  cursor: default;
}

.history-day:nth-child(7n) {
  border-right: 0;
}

.history-day:nth-last-child(-n + 7) {
  border-bottom: 0;
}

.history-day span {
  font-size: 22px;
  color: rgba(238, 247, 255, 0.72);
}

.history-day strong {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-size: 31px;
  line-height: 1;
  color: #ffffff;
  text-shadow: 0 0 16px rgba(238, 247, 255, 0.24);
}

.history-day small {
  font-size: 18px;
  color: rgba(255, 255, 255, 0.84);
}

.history-day.has-record {
  cursor: pointer;
}

.history-day.has-record:hover {
  z-index: 1;
  box-shadow: inset 0 0 0 2px rgba(81, 229, 255, 0.62), inset 0 0 26px rgba(81, 229, 255, 0.2);
}

.history-day.hot {
  background: linear-gradient(135deg, rgba(255, 79, 100, 0.9), rgba(203, 52, 76, 0.82));
}

.history-day.warm {
  background: linear-gradient(135deg, rgba(243, 167, 36, 0.82), rgba(165, 101, 18, 0.82));
}

.history-day.cool {
  background: linear-gradient(135deg, rgba(52, 120, 220, 0.88), rgba(38, 83, 162, 0.82));
}

.history-day.cold {
  background: linear-gradient(135deg, rgba(36, 64, 102, 0.92), rgba(15, 38, 76, 0.88));
}

.history-day.muted {
  background: rgba(2, 9, 22, 0.34);
}

.history-day.muted span {
  color: rgba(127, 159, 189, 0.36);
}

.history-day:disabled {
  pointer-events: none;
}

.history-day.today::after {
  content: "";
  position: absolute;
  inset: 7px;
  border: 1px solid rgba(81, 229, 255, 0.5);
  pointer-events: none;
}

.history-empty {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 260px;
  color: var(--muted);
  font-size: 18px;
}

.history-status {
  min-height: 22px;
  margin-top: 12px;
  color: rgba(127, 159, 189, 0.72);
  font-size: 13px;
  text-align: right;
}

.history-modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(2, 9, 22, 0.72);
  backdrop-filter: blur(6px);
}

.history-modal.open {
  display: flex;
}

.history-modal-card {
  position: relative;
  width: min(680px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(81, 229, 255, 0.34);
  border-radius: 10px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(6, 26, 51, 0.98), rgba(2, 10, 23, 0.98)),
    radial-gradient(circle at 50% 0%, rgba(81, 229, 255, 0.15), transparent 46%);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.48), inset 0 0 26px rgba(25, 183, 255, 0.1);
}

.history-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  min-height: 0;
  padding: 0;
  border: 1px solid rgba(81, 229, 255, 0.28);
  border-radius: 50%;
  background: rgba(3, 18, 38, 0.86);
  color: var(--ink);
  font-size: 24px;
  line-height: 1;
}

.history-modal-card h2 {
  margin: 0 44px 18px 0;
  font-size: 24px;
}

.history-modal-mood {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(0, 174, 255, 0.2);
  border-radius: 8px;
  background: rgba(3, 18, 38, 0.72);
}

.history-modal-mood span {
  color: var(--muted);
}

.history-modal-mood strong {
  font-size: 24px;
}

.history-modal-evidence {
  display: grid;
  gap: 8px;
}

.history-evidence-row {
  display: grid;
  grid-template-columns: 1fr 86px 110px;
  align-items: center;
  gap: 12px;
  min-height: 54px;
  padding: 10px 14px;
  border: 1px solid rgba(0, 174, 255, 0.18);
  border-radius: 8px;
  background: rgba(3, 18, 38, 0.62);
}

.history-evidence-row span {
  font-weight: 700;
}

.history-evidence-row strong {
  text-align: right;
  font-size: 22px;
}

.history-evidence-row em {
  justify-self: end;
  min-width: 82px;
  padding: 5px 12px;
  border-radius: 999px;
  font-style: normal;
  font-weight: 800;
  text-align: center;
}

.history-evidence-row em.good {
  border: 1px solid rgba(21, 217, 145, 0.52);
  color: #55f2b3;
  background: rgba(21, 217, 145, 0.14);
}

.history-evidence-row em.mid {
  border: 1px solid rgba(243, 167, 36, 0.52);
  color: #ffc766;
  background: rgba(243, 167, 36, 0.14);
}

.history-evidence-row em.warn,
.history-evidence-row em.bad {
  border: 1px solid rgba(255, 79, 100, 0.52);
  color: #ff8796;
  background: rgba(255, 79, 100, 0.14);
}

.admin-login-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(2, 9, 22, 0.72);
  backdrop-filter: blur(6px);
}

.admin-login-modal.open {
  display: flex;
}

.admin-login-card {
  width: 360px;
  border-radius: 10px;
  background: #ffffff;
  color: #172033;
  padding: 22px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

.admin-login-card h2 {
  margin-bottom: 18px;
  font-size: 20px;
}

.admin-login-card label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.admin-login-card span {
  color: #64748b;
  font-size: 13px;
}

.admin-login-card input {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #172033;
}

.admin-login-error {
  min-height: 20px;
  color: #dc2626;
  font-size: 13px;
}

.admin-login-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 10px;
}

.admin-login-actions button:first-child {
  background: #e2e8f0;
  color: #334155;
}

.admin-login-actions button:last-child {
  background: #2563eb;
  color: #ffffff;
}


@media (max-width: 1100px) {
  body {
    min-width: 0;
  }

  .command-grid,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .score-hero {
    min-height: 180px;
  }

  .score-hero strong {
    font-size: 78px;
  }
}


@media (max-width: 760px) {
  body {
    min-width: 0;
    font-size: 13px;
  }

  .app-shell {
    width: min(100vw - 16px, 760px);
    padding: 12px 0 22px;
  }

  .topbar {
    height: auto;
    min-height: 34px;
    margin-bottom: 10px;
  }

  h1 {
    font-size: 20px;
    line-height: 1.2;
  }

  .command-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  .home-grid {
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }

  #homePage .conclusion-card,
  #homePage .panel {
    padding: 14px;
  }

  #homePage .conclusion-head,
  #homePage .summary-list,
  #homePage .snapshot-grid,
  #homePage #autoConclusion,
  #homePage .evidence-list {
    margin: 0;
  }

  .score-hero {
    --score-hud-shift-y: 0px;
    order: -1;
    min-height: auto;
    display: grid;
    place-items: start;
    isolation: auto;
    overflow: hidden;
    grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) !important;
    grid-template-rows: auto auto !important;
    column-gap: 10px;
    row-gap: 2px;
    padding: 14px;
    border: 1px solid rgba(25, 183, 255, 0.26);
    border-radius: 6px;
    background:
      linear-gradient(180deg, rgba(6, 29, 61, 0.66), rgba(2, 13, 30, 0.82)),
      rgba(3, 18, 38, 0.86);
    box-shadow:
      0 0 0 1px rgba(81, 229, 255, 0.08) inset,
      0 12px 26px rgba(0, 0, 0, 0.2);
    text-align: left;
    cursor: default;
  }

  .score-hero::after {
    display: none;
  }

  .score-hero > span,
  .score-hero small {
    display: none;
  }

  .score-hero strong {
    grid-column: 1;
    grid-row: 1;
    min-width: 0;
    font-size: 32px;
    line-height: 0.9;
    margin: 0;
    padding: 0;
    text-align: left;
    align-self: end;
  }

  .score-breakdown {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    display: grid;
    gap: 2px;
    margin: 0;
    padding: 0;
    font-size: 11px;
    align-self: start;
    justify-self: start;
  }

  .score-breakdown span {
    display: block;
    padding: 0;
    margin: 0;
    color: #8fb1cf;
    font-size: 11px;
    line-height: 1.2;
  }

  .score-breakdown b {
    color: #f4f8ff;
    font-size: 14px;
  }

  .score-tooltip {
    grid-column: 2;
    grid-row: 1 / 3;
    position: static;
    width: 100%;
    min-width: 0;
    left: auto;
    bottom: auto;
    transform: none;
    border: 0;
    border-left: 1px solid rgba(81, 229, 255, 0.15);
    background: transparent;
    box-shadow: none;
    color: #9fb8cf;
    font-size: 11px;
    line-height: 1.4;
    padding: 0 0 0 10px;
    margin: 0;
    opacity: 1;
    overflow-wrap: break-word;
    word-break: break-all;
  }

  .score-hero.tooltip-visible .score-tooltip,
  .score-hero:hover .score-tooltip {
    transform: none;
    opacity: 1;
  }

  .conclusion-card {
    min-height: auto;
  }

  .conclusion-head {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin-left: 0;
    margin-right: 0;
  }

  .conclusion-head div {
    min-height: 68px;
    grid-template-columns: 44px 1fr;
    column-gap: 12px;
    padding: 10px 12px;
    width: 100%;
    overflow: visible;
    background-clip: padding-box;
  }

  .item-icon {
    width: 38px;
    height: 38px;
  }

  .conclusion-head strong {
    font-size: 24px;
  }

  .snapshot-row {
    min-height: 60px;
    grid-template-columns: 46px 1fr auto;
    gap: 10px;
    padding: 0 12px;
  }

  .snapshot-icon {
    width: 36px;
    height: 36px;
  }

  .snapshot-row span {
    font-size: 16px;
  }

  .snapshot-row strong {
    font-size: 24px;
  }

  .snapshot-secondary {
    min-height: 96px;
  }

  .snapshot-secondary div {
    gap: 10px;
    padding: 14px 6px;
  }

  .snapshot-secondary span {
    font-size: 13px;
  }

  .snapshot-secondary strong {
    font-size: 23px;
  }

  .summary-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .summary-list div {
    min-height: 82px;
    grid-template-columns: 34px minmax(0, 1fr);
    column-gap: 9px;
    padding: 10px;
  }

  .summary-list .item-icon {
    width: 32px;
    height: 32px;
  }

  .summary-list dt {
    font-size: 12px;
    line-height: 1.25;
  }

  .summary-list dd {
    margin-top: 4px;
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }

  .panel-title {
    margin-bottom: 10px;
  }

  #homePage .panel-title {
    margin: 0 0 12px;
    padding-bottom: 10px;
  }

  #autoConclusion {
    min-height: auto;
    padding: 14px;
    line-height: 1.7;
  }

  .evidence-button {
    min-height: 58px;
    grid-template-columns: 34px minmax(0, 1fr) auto 18px;
    gap: 10px;
    padding: 10px;
  }

  .evidence-icon {
    width: 30px;
    height: 30px;
  }

  .evidence-name {
    grid-column: 2;
    min-width: 0;
  }

  .evidence-score {
    grid-column: 2;
    grid-row: 2;
    font-size: 16px;
  }

  .evidence-button .state {
    grid-column: 3;
    grid-row: 1 / span 2;
    justify-self: end;
    align-self: center;
    white-space: nowrap;
  }

  .evidence-toggle {
    grid-column: 4;
    grid-row: 1 / span 2;
    width: 18px;
    justify-self: end;
    align-self: center;
    text-align: right;
  }

  .evidence-detail {
    display: none;
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .evidence-item.open .evidence-detail {
    display: grid;
  }

  .evidence-detail div {
    min-height: 48px;
  }

  .admin-login-card {
    width: min(360px, calc(100vw - 28px));
  }

  .mobile-history-entry {
    display: flex;
    justify-content: center;
    margin: 18px 0 2px;
  }

  .mobile-history-entry button {
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: rgba(127, 159, 189, 0.62);
    font-size: 12px;
    text-decoration: underline;
  }

  .history-shell {
    width: 100%;
    padding: 12px 10px 16px;
    border-radius: 8px;
  }

  .history-topbar {
    justify-content: flex-end;
    margin-bottom: 12px;
  }

  .mobile-history-home {
    display: inline-flex;
  }

  #historyBackAdmin {
    display: none;
  }

  .history-toolbar {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 8px;
    margin-bottom: 14px;
  }

  .history-nav {
    width: 38px;
    height: 38px;
    border-radius: 7px;
    font-size: 26px;
  }

  .history-month {
    height: 40px;
    border-radius: 7px;
    font-size: 20px;
  }

  .history-weekdays {
    margin-bottom: 8px;
    font-size: 13px;
  }

  .history-calendar {
    grid-auto-rows: 62px;
    border-radius: 7px;
  }

  .history-day {
    gap: 5px;
    padding: 6px 2px;
  }

  .history-day span {
    font-size: 13px;
  }

  .history-day strong {
    display: grid;
    gap: 2px;
    justify-items: center;
    font-size: 16px;
    line-height: 1;
  }

  .history-day small {
    font-size: 11px;
  }

  .history-day.today::after {
    inset: 4px;
  }

  .history-status {
    min-height: 18px;
    margin-top: 8px;
    font-size: 12px;
    text-align: center;
  }

  .history-modal {
    align-items: flex-start;
    padding: calc(64px + env(safe-area-inset-top)) 12px 12px;
  }

  .history-modal-card {
    max-height: calc(100vh - 88px - env(safe-area-inset-top));
    padding: 18px 14px;
    border-radius: 8px;
  }

  .history-modal-card h2 {
    margin-right: 42px;
    font-size: 18px;
  }

  .history-modal-mood {
    padding: 12px;
  }

  .history-modal-mood strong {
    font-size: 20px;
  }

  .history-evidence-row {
    grid-template-columns: 1fr auto;
    gap: 8px;
    min-height: 58px;
    padding: 10px;
  }

  .history-evidence-row strong {
    font-size: 18px;
  }

  .history-evidence-row em {
    grid-column: 1 / -1;
    justify-self: start;
    min-width: 72px;
    font-size: 12px;
  }

  .footer-admin {
    display: none;
  }
}
