:root {
  --bg: #dff2f7;
  --bg-deep: #d1ebf2;
  --surface: #ffffff;
  --surface-soft: #f5fbfd;
  --panel: #edf7fb;
  --ink: #24384a;
  --muted: #7f95a2;
  --line: #dcecf3;
  --primary: #18a7b9;
  --primary-deep: #0f95a8;
  --accent: #ffb14d;
  --success: #27b18d;
  --shadow: 0 18px 42px rgba(102, 155, 176, 0.15);
  --soft-shadow: 0 10px 24px rgba(145, 186, 203, 0.14);
  --shell-radius: 30px;
  --card-radius: 22px;
  --pill-radius: 999px;
  --font: "Inter", "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 10%, rgba(255, 255, 255, 0.34), transparent 220px),
    radial-gradient(circle at 88% 12%, rgba(255, 255, 255, 0.22), transparent 240px),
    linear-gradient(180deg, var(--bg), var(--bg-deep));
}

a {
  color: inherit;
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
}

.app-page,
.device-page {
  height: 100vh;
  padding: 8px;
}

.tablet-shell {
  display: grid;
  grid-template-columns: 92px minmax(0, 290px) minmax(0, 1fr);
  gap: 12px;
  width: 100%;
  height: calc(100vh - 16px);
  padding: 12px;
  border-radius: var(--shell-radius);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}

.tablet-shell.single-main {
  grid-template-columns: 92px minmax(0, 1fr);
}

.tablet-shell.no-rail {
  grid-template-columns: 1fr;
}

.rail {
  display: grid;
  align-content: space-between;
  padding: 10px 0;
  border-radius: 24px;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
  color: #fff;
  box-shadow: var(--soft-shadow);
}

.rail-top {
  display: grid;
  gap: 12px;
}

.logo-chip {
  display: grid;
  width: 48px;
  height: 48px;
  margin: 0 auto;
  place-items: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 800;
}

.rail-nav {
  display: grid;
  gap: 10px;
}

.rail-link {
  display: grid;
  gap: 4px;
  justify-items: center;
  padding: 8px 4px;
  color: rgba(255, 255, 255, 0.82);
  text-decoration: none;
  font-size: 10px;
  line-height: 1.15;
  text-align: center;
}

.rail-link span:last-child {
  max-width: 74px;
  overflow-wrap: anywhere;
}

.rail-link.active {
  color: var(--primary-deep);
}

.rail-link.active .rail-icon {
  background: #fff;
}

.rail-icon {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  font-size: 14px;
  font-weight: 700;
}

.column-panel,
.main-panel {
  height: 100%;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow);
}

.column-panel {
  padding: 16px;
  overflow: auto;
}

.main-panel {
  padding: 16px 18px;
  overflow: auto;
}

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

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-head h2,
.section-head h3,
.section-head p {
  margin: 0;
}

.section-head h2,
.section-head h3 {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.2;
}

.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.soft-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: var(--pill-radius);
  background: #eaf8fb;
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

.soft-chip.warn {
  background: #fff2de;
  color: #b5741f;
}

.soft-chip.accent {
  background: #fff6ec;
  color: #de8f31;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.mini-grid {
  display: grid;
  gap: 10px;
}

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

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

.summary-card,
.soft-card,
.list-card,
.metric-card,
.chart-card,
.form-card {
  border-radius: var(--card-radius);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.summary-card,
.soft-card,
.chart-card,
.form-card {
  padding: 14px;
}

.summary-card strong {
  display: block;
  margin-top: 6px;
  color: var(--primary-deep);
  font-size: 26px;
  font-weight: 700;
}

.summary-card span,
.summary-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.summary-card.hero {
  background: linear-gradient(180deg, #1aa8ba, #149db0);
  border-color: transparent;
  color: #fff;
}

.summary-card.hero strong,
.summary-card.hero span,
.summary-card.hero p {
  color: #fff;
}

.soft-card h4,
.soft-card p,
.chart-card h4,
.chart-card p {
  margin: 0;
}

.soft-card h4,
.chart-card h4 {
  font-size: 17px;
  font-weight: 600;
}

.soft-card p,
.chart-card p {
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
  font-size: 13px;
}

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

.category-card {
  display: grid;
  min-height: 80px;
  padding: 12px;
  border-radius: 22px;
  border: 2px solid rgba(24, 167, 185, 0.18);
  background: rgba(255, 255, 255, 0.96);
  align-content: center;
  justify-items: center;
  text-align: center;
}

.category-card.filled {
  background: #dff3f8;
  border-color: transparent;
}

.category-card .emoji {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-deep);
}

.category-card strong {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-deep);
}

.list-card {
  padding: 10px;
}

.list-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: #fff;
}

.list-item + .list-item {
  margin-top: 8px;
}

.avatar,
.round-icon {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f1f9fc;
  box-shadow: 0 6px 14px rgba(149, 188, 204, 0.14);
}

.avatar {
  width: 40px;
  height: 40px;
  font-size: 14px;
  font-weight: 700;
}

.round-icon {
  width: 34px;
  height: 34px;
  color: var(--primary-deep);
  font-size: 13px;
  font-weight: 700;
}

.item-title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}

.item-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.plus-btn {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 12px;
  background: #eaf8fb;
  color: var(--primary-deep);
  font-weight: 800;
}

.profile-strip {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.profile-photo {
  width: 80px;
  height: 80px;
  margin: 0 auto;
  border-radius: 24px;
  background: linear-gradient(145deg, #e3f3f8, #f9fdff);
  box-shadow: inset 0 0 0 1px rgba(24, 167, 185, 0.08);
}

.profile-meta {
  display: grid;
  gap: 8px;
}

.main-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.92fr);
  gap: 12px;
  align-items: start;
}

.hero-screen {
  display: grid;
  align-content: space-between;
  min-height: 228px;
  padding: 20px;
  border-radius: 28px;
  background: linear-gradient(180deg, #1aa8ba, #149db0);
  color: #fff;
  box-shadow: var(--soft-shadow);
}

.hero-screen strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(56px, 7vw, 86px);
  line-height: 0.95;
  font-weight: 700;
}

.hero-screen p {
  margin: 14px 0 0;
  max-width: 420px;
  font-size: 22px;
  line-height: 1.2;
}

.form-grid {
  display: grid;
  gap: 10px;
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
textarea,
select {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfeff;
  color: var(--ink);
}

textarea {
  min-height: 88px;
  resize: vertical;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 14px;
  background: linear-gradient(180deg, var(--primary), var(--primary-deep));
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.btn.secondary {
  background: #eef7fb;
  color: var(--ink);
}

.btn.accent {
  background: linear-gradient(180deg, #ffbf6b, #ffac40);
  color: #fff;
}

.chat-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 12px;
}

.chat-pane {
  padding: 14px;
  border-radius: var(--card-radius);
  background: #fff;
  border: 1px solid var(--line);
}

.message-area {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 320px;
}

.message {
  max-width: 72%;
  padding: 12px 14px;
  border-radius: 18px;
  line-height: 1.45;
  font-size: 13px;
}

.message.from-doctor {
  border: 1.5px solid rgba(24, 167, 185, 0.45);
  background: #fff;
}

.message.from-user {
  margin-left: auto;
  background: #eef8fb;
  color: var(--muted);
}

.message-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.appointment-grid,
.calendar-strip {
  display: grid;
  gap: 10px;
}

.time-slot {
  padding: 10px 14px;
  border-radius: 14px;
  background: #fff8ef;
  color: #d88b24;
  text-align: center;
  font-weight: 700;
}

.time-slot.active {
  background: linear-gradient(180deg, #ffbf6b, #ffac40);
  color: #fff;
}

.data-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.data-pill {
  padding: 10px 12px;
  border-radius: 14px;
  background: #eef8fb;
  text-align: center;
}

.data-pill strong {
  display: block;
  color: var(--ink);
  font-size: 16px;
  font-weight: 700;
}

.data-pill span {
  color: var(--muted);
  font-size: 11px;
}

.wave {
  position: relative;
  height: 106px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(24, 167, 185, 0.06), rgba(24, 167, 185, 0)),
    repeating-linear-gradient(
      to right,
      rgba(36, 56, 74, 0.06),
      rgba(36, 56, 74, 0.06) 1px,
      transparent 1px,
      transparent 46px
    );
}

.wave::before,
.wave::after {
  content: "";
  position: absolute;
  inset: auto 0 32px 0;
  height: 54px;
  border-radius: 999px;
}

.wave::before {
  background:
    radial-gradient(circle at 10% 60%, transparent 0 18px, rgba(24, 167, 185, 0.18) 19px 46px, transparent 47px),
    radial-gradient(circle at 42% 22%, transparent 0 18px, rgba(24, 167, 185, 0.22) 19px 42px, transparent 43px),
    radial-gradient(circle at 76% 58%, transparent 0 18px, rgba(24, 167, 185, 0.16) 19px 44px, transparent 45px);
}

.wave::after {
  inset: auto 0 44px 0;
  height: 2px;
  background: linear-gradient(90deg, #49bfd0 0%, #27b18d 40%, #49bfd0 100%);
  transform: skewY(-5deg);
}

.guide-banner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(24, 167, 185, 0.12), rgba(24, 167, 185, 0.04));
  border: 1px solid rgba(24, 167, 185, 0.14);
}

.guide-banner h1,
.guide-banner p {
  margin: 0;
}

.guide-banner h1 {
  font-size: 24px;
  font-weight: 700;
}

.guide-banner p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.step-list {
  display: grid;
  gap: 10px;
}

.step-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.step-index {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  background: #eaf8fb;
  color: var(--primary-deep);
  font-weight: 800;
}

.step-card h4,
.step-card p {
  margin: 0;
}

.step-card h4 {
  font-size: 15px;
  font-weight: 700;
}

.step-card p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.dashboard-grid {
  display: grid;
  grid-template-columns: 1.08fr 0.92fr;
  gap: 12px;
  align-items: stretch;
}

.dashboard-stack {
  display: grid;
  gap: 12px;
}

.dashboard-hero {
  display: grid;
  align-content: space-between;
  min-height: 304px;
  padding: 24px;
  border-radius: 28px;
  background: linear-gradient(180deg, #1aa8ba, #149db0);
  color: #fff;
  box-shadow: var(--soft-shadow);
}

.dashboard-hero strong {
  display: block;
  margin-top: 10px;
  font-size: clamp(86px, 9vw, 138px);
  line-height: 0.92;
  font-weight: 700;
  letter-spacing: 0;
}

.dashboard-hero p {
  margin: 16px 0 0;
  max-width: 420px;
  font-size: 22px;
  line-height: 1.18;
}

.dashboard-clock-note {
  display: grid;
  gap: 6px;
}

.dashboard-clock-note span,
.dashboard-clock-note small {
  display: block;
}

.dashboard-clock-note span {
  font-size: 15px;
  font-weight: 700;
  opacity: 0.94;
}

.dashboard-clock-note small {
  font-size: 13px;
  opacity: 0.82;
}

.dashboard-stat-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 12px;
}

.dashboard-stat-grid .summary-card {
  min-height: 132px;
}

.dashboard-stat-grid .summary-card.primary {
  min-height: 152px;
  grid-row: span 2;
  display: grid;
  align-content: center;
}

.dashboard-stat-grid .summary-card.primary strong {
  font-size: 44px;
  line-height: 1;
}

.dashboard-stat-grid .summary-card.primary p {
  font-size: 16px;
  line-height: 1.45;
}

.dashboard-card {
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
}

.dashboard-card h3,
.dashboard-card p {
  margin: 0;
}

.dashboard-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.pillbox-track {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.pillbox-slot {
  min-height: 136px;
  padding: 14px 12px;
  border-radius: 24px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  display: grid;
  align-content: space-between;
}

.pillbox-slot.current {
  background: linear-gradient(180deg, rgba(255, 177, 77, 0.22), rgba(255, 177, 77, 0.08));
  border: 2px solid rgba(255, 177, 77, 0.52);
  box-shadow: 0 12px 28px rgba(255, 177, 77, 0.18);
}

.pillbox-slot.done {
  background: #f4fbf7;
  border-color: rgba(39, 177, 141, 0.24);
}

.pillbox-slot.upcoming {
  background: #f6f9fb;
  border-color: rgba(127, 149, 162, 0.2);
}

.pillbox-slot strong,
.pillbox-slot span,
.pillbox-slot p {
  margin: 0;
}

.pillbox-slot strong {
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.pillbox-slot span {
  color: var(--primary-deep);
  font-size: 12px;
  font-weight: 700;
}

.pillbox-slot p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pillbox-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff;
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 700;
}

.pillbox-slot.current .pillbox-badge {
  background: linear-gradient(180deg, #ffbf6b, #ffac40);
  color: #fff;
}

.pillbox-slot.done .pillbox-badge {
  background: #27b18d;
  color: #fff;
}

.pillbox-slot.upcoming .pillbox-badge {
  background: #eef4f7;
  color: var(--muted);
}

.dashboard-focus-card {
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
}

.dashboard-focus-card h3,
.dashboard-focus-card p {
  margin: 0;
}

.dashboard-focus-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.medicine-highlight {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: 22px;
  background: linear-gradient(180deg, #fff4e4, #fff9f1);
  border: 1px solid rgba(255, 177, 77, 0.38);
}

.medicine-highlight h4,
.medicine-highlight p {
  margin: 0;
}

.medicine-highlight h4 {
  font-size: 20px;
  font-weight: 700;
  color: #b56d11;
}

.medicine-highlight p {
  margin-top: 6px;
  color: #8d6b3d;
  font-size: 14px;
  line-height: 1.45;
}

.medicine-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.medicine-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  min-width: 120px;
  padding: 0 18px;
  border-radius: 18px;
  background: #fff;
  border: 2px solid rgba(255, 177, 77, 0.46);
  color: #b56d11;
  font-size: 18px;
  font-weight: 700;
  box-shadow: 0 8px 18px rgba(255, 177, 77, 0.12);
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot.done {
  background: #27b18d;
}

.legend-dot.current {
  background: #ffb14d;
}

.legend-dot.upcoming {
  background: #cddae1;
}

.dashboard-timeline {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.dashboard-timeline-item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-soft);
}

.dashboard-time {
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-deep);
}

.dashboard-weeks {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.dashboard-pill-card {
  min-height: 130px;
  padding: 16px;
  border-radius: 24px;
  background: #fff;
  border: 1px solid var(--line);
  display: grid;
  align-content: space-between;
}

.dashboard-pill-card strong,
.dashboard-pill-card p,
.dashboard-pill-card span {
  margin: 0;
}

.dashboard-pill-card strong {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-deep);
}

.dashboard-pill-card p,
.dashboard-pill-card span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.dashboard-month {
  margin-top: 14px;
  padding: 16px;
  border-radius: 24px;
  background: linear-gradient(180deg, #fff9f1, #ffffff);
  border: 1px solid rgba(255, 177, 77, 0.22);
}

.dashboard-month-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-month-head h4,
.dashboard-month-head p {
  margin: 0;
}

.dashboard-month-head h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.dashboard-month-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.dashboard-month-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 10px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid rgba(255, 177, 77, 0.3);
  color: #b56d11;
  font-weight: 700;
}

.dashboard-weekdays,
.dashboard-month-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-weekdays {
  margin-top: 16px;
}

.dashboard-weekdays span {
  text-align: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-month-grid {
  margin-top: 12px;
}

.dashboard-day {
  min-height: 76px;
  padding: 8px 6px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 236, 243, 0.9);
  display: grid;
  align-content: start;
  justify-items: center;
  text-align: center;
}

.dashboard-day.muted {
  opacity: 0.42;
}

.dashboard-day .day-number,
.dashboard-day .day-note,
.dashboard-day .day-time {
  display: block;
}

.dashboard-day .day-number {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
}

.dashboard-day .day-note {
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.dashboard-day .day-time {
  margin-top: 4px;
  color: var(--primary-deep);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-day.today {
  background: #ffffff;
  border: 2px solid rgba(24, 167, 185, 0.28);
  box-shadow: 0 10px 18px rgba(24, 167, 185, 0.08);
}

.dashboard-day.current {
  background: linear-gradient(180deg, #ffbf6b, #ffac40);
  border-color: transparent;
  box-shadow: 0 12px 22px rgba(255, 177, 77, 0.22);
}

.dashboard-day.current .day-number,
.dashboard-day.current .day-note,
.dashboard-day.current .day-time {
  color: #fff;
}

.record-table {
  display: grid;
  gap: 8px;
}

.record-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) 110px;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
}

.record-row strong,
.record-row span,
.record-row p {
  margin: 0;
}

.record-row span,
.record-row p {
  color: var(--muted);
  font-size: 12px;
}

.alert-stack {
  display: grid;
  gap: 10px;
}

.alert-card {
  padding: 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.alert-card.warn {
  background: #fff8ef;
  border-color: rgba(255, 177, 77, 0.3);
}

.alert-card.success {
  background: #f3fcf8;
  border-color: rgba(39, 177, 141, 0.24);
}

.alert-card h4,
.alert-card p {
  margin: 0;
}

.alert-card h4 {
  font-size: 15px;
  font-weight: 700;
}

.alert-card p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

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

.compare-card {
  padding: 14px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.compare-card h4,
.compare-card p {
  margin: 0;
}

.compare-card h4 {
  font-size: 15px;
  font-weight: 700;
}

.compare-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.timeline-list {
  display: grid;
  gap: 10px;
}

.timeline-day {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 14px;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.timeline-day strong,
.timeline-day p {
  margin: 0;
}

.timeline-day p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-panel {
  padding: 16px;
  border-radius: 22px;
  background: #fff;
  border: 1px solid var(--line);
}

.ai-panel h3,
.ai-panel p {
  margin: 0;
}

.ai-panel p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.status-note {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.status-note.live {
  color: var(--success);
}

.status-note.fallback {
  color: #c07d20;
}

.status-note.error {
  color: #c95a5a;
}

.file-hint {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.file-hint.ready {
  color: var(--success);
}

.helper-box {
  min-height: 120px;
  margin-top: 12px;
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.helper-box p {
  margin: 0;
  color: var(--ink);
  line-height: 1.65;
}

.empty-state {
  padding: 14px;
  border-radius: 18px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.box-guide-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.box-guide-card {
  padding: 14px;
  border-radius: 20px;
  background: linear-gradient(180deg, #eef9fc, #ffffff);
  border: 1px solid var(--line);
}

.box-guide-card h4,
.box-guide-card p,
.box-guide-card ul {
  margin: 0;
}

.box-guide-card h4 {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary-deep);
}

.box-guide-card p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.box-guide-card ul {
  margin-top: 10px;
  padding-left: 18px;
  color: var(--ink);
}

.box-guide-card li + li {
  margin-top: 6px;
}

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

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

.device-page {
  background: linear-gradient(180deg, #dff2f7, #d4ecf3);
}

.device-stage {
  display: grid;
  height: calc(100vh - 16px);
  place-items: center;
}

.device-card {
  width: min(1040px, 100%);
  height: 100%;
  max-height: 760px;
  padding: 16px;
  border-radius: 30px;
  background: linear-gradient(180deg, #1aa8ba, #149db0);
  box-shadow: 0 24px 56px rgba(24, 98, 126, 0.24);
}

.device-screen {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  padding: 24px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.98);
}

.device-screen-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.device-time {
  color: var(--ink);
  font-size: 32px;
  font-weight: 700;
}

.device-screen-note {
  color: var(--muted);
  font-size: 14px;
}

.device-focus {
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
}

.device-focus strong {
  color: var(--primary-deep);
  font-size: clamp(80px, 10vw, 150px);
  line-height: 0.9;
  font-weight: 700;
}

.device-focus p {
  max-width: 760px;
  margin: 14px 0 0;
  font-size: clamp(28px, 3.8vw, 48px);
  line-height: 1.15;
}

.device-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.device-actions .btn {
  min-height: 72px;
  border-radius: 20px;
  font-size: 24px;
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app-page,
  .device-page {
    height: auto;
    min-height: 100vh;
  }

  .tablet-shell,
  .tablet-shell.single-main,
  .dashboard-grid,
  .main-split,
  .chat-shell {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 16px);
  }

  .column-panel,
  .main-panel {
    height: auto;
    overflow: visible;
  }

  .rail {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    height: auto;
    padding: 14px;
  }

  .rail-top {
    grid-column: 1 / -1;
    grid-template-columns: auto 1fr;
    align-items: center;
  }

  .rail-nav {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .app-page,
  .device-page {
    padding: 6px;
  }

  .mini-grid.two,
  .mini-grid.three,
  .panel-grid,
  .results-grid,
  .notes-grid,
  .dashboard-stat-grid,
  .pillbox-track,
  .dashboard-weeks,
  .compare-grid,
  .data-row,
  .device-actions,
  .message-input {
    grid-template-columns: 1fr;
  }

  .tablet-shell,
  .column-panel,
  .main-panel,
  .device-card,
  .device-screen {
    padding: 12px;
  }

  .hero-screen p {
    font-size: 18px;
  }
}
