:root {
  color-scheme: light;
  --bg: #f4f1ea;
  --surface: #fffaf1;
  --ink: #211b16;
  --muted: #74685e;
  --line: #ddd0bf;
  --accent: #9f3f2f;
  --accent-strong: #702a22;
  --green: #2f6f5e;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 18px 16px 32px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  min-height: 118px;
  padding: 18px 2px 22px;
}

.liuyao-web-topbar {
  min-height: 92px;
}

.liuyao-web-hidden {
  display: none !important;
}

.liuyao-result .result-actions {
  grid-template-columns: 82px minmax(0, 1fr) 92px;
}

.liuyao-result .result-actions button {
  white-space: nowrap;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--green);
  font-size: 13px;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 12em;
  font-size: 30px;
  line-height: 1.16;
}

h2 {
  font-size: 18px;
}

.panel,
.result-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 12px 30px rgba(69, 46, 26, 0.08);
}

.panel {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.field {
  display: grid;
  gap: 8px;
}

.field > span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf9;
  color: var(--ink);
  font: inherit;
  padding: 0 12px;
  outline: none;
}

select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 12px) 20px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(159, 63, 47, 0.12);
}

.feature-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 14px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #eadfce;
}

.feature-tab {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.feature-tab.is-active {
  background: var(--accent-strong);
  color: #fffaf1;
}

.feature-section {
  display: grid;
  gap: 16px;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-height: 44px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f2eadf;
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.segmented label {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 6px;
  color: var(--muted);
  font-weight: 700;
}

.segmented input:checked + label {
  background: var(--accent);
  color: #fffaf1;
}

.date-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

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

.liuyao-time-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.checkbox-field {
  align-content: end;
}

.checkbox-field input {
  width: 46px;
  height: 46px;
  margin: 0;
  accent-color: var(--accent);
}

.primary-button,
.result-actions button,
.secondary-button,
.text-button {
  border: 0;
  border-radius: 7px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.primary-button {
  height: 50px;
  margin-top: 4px;
  background: var(--accent-strong);
  color: #fffaf1;
}

.primary-button:disabled {
  opacity: 0.65;
}

.secondary-button {
  min-height: 42px;
  padding: 0 12px;
  background: var(--green);
  color: white;
}

.text-button {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  background: #fffdf9;
  color: var(--ink);
}

.secondary-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.result-panel {
  margin-top: 16px;
  overflow: hidden;
}

.result-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.result-actions button {
  min-width: 68px;
  height: 36px;
  background: var(--green);
  color: white;
}

.result-actions button:disabled {
  opacity: 0.45;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(33, 27, 22, 0.42);
}

.modal {
  width: min(100%, 480px);
  max-height: min(82vh, 720px);
  overflow: auto;
  padding: 18px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 20px 60px rgba(33, 27, 22, 0.22);
}

.modal p {
  margin: 12px 0;
  color: #3a3028;
  font-size: 14px;
  line-height: 1.65;
}

.usage-list {
  margin: 12px 0 0;
  padding-left: 22px;
  color: #3a3028;
  font-size: 14px;
  line-height: 1.7;
}

.usage-list li {
  margin: 8px 0;
}

.modal .primary-button {
  width: 100%;
  margin-top: 10px;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 14px;
}

.modal-actions .primary-button,
.modal-actions .text-button {
  width: 100%;
  min-height: 46px;
  margin-top: 0;
}

pre {
  margin: 0;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  color: #2d241d;
  font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.inline-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 82px;
  gap: 8px;
}

.liuyao-panel {
  gap: 16px;
}

.liuyao-view {
  display: grid;
  gap: 16px;
}

.liuyao-note {
  min-height: 34px;
  display: flex;
  align-items: center;
  padding: 0 10px;
  border-radius: 7px;
  background: #f0e6d8;
  color: var(--green);
  font-size: 13px;
  font-weight: 800;
}

.calendar-panel {
  width: min(100%, 480px);
  max-height: min(86vh, 720px);
  overflow: auto;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.calendar-open-button {
  width: 100%;
}

.calendar-modal {
  z-index: 12;
  align-items: end;
}

.calendar-modal .calendar-panel {
  box-shadow: 0 20px 60px rgba(33, 27, 22, 0.22);
}

.calendar-panel > .primary-button {
  width: 100%;
  margin-top: 0;
}

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

.calendar-panel-head span {
  font-size: 13px;
  font-weight: 900;
}

.calendar-panel-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

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

.calendar-input-grid.time-grid {
  grid-template-columns: 1fr 1fr 86px;
  align-items: end;
}

.calendar-policy-grid {
  display: grid;
  gap: 8px;
}

.calendar-timezone {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f0e4;
}

.calendar-timezone span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.calendar-timezone strong {
  color: var(--green);
  font-size: 12px;
}

.calendar-result {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  min-height: 36px;
  padding-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.calendar-result div {
  display: grid;
  gap: 2px;
  min-height: 54px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f0e4;
}

.calendar-result span,
.calendar-result small {
  color: var(--muted);
  font-size: 11px;
}

.calendar-result strong {
  color: var(--ink);
  font-size: 14px;
}

.coin-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf9;
}

.entry-mode-switch {
  grid-template-columns: 1fr 1fr;
  min-height: 38px;
}

.cast-action {
  display: grid;
  gap: 8px;
}

.cast-action small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.history-panel {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(69, 46, 26, 0.08);
}

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

.history-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-list {
  display: grid;
  gap: 8px;
}

.history-empty,
.history-item {
  min-height: 56px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf9;
}

.history-empty {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-item {
  display: grid;
  gap: 4px;
  width: 100%;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.history-item strong {
  font-size: 14px;
}

.history-item span,
.history-item small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.history-item .legacy-warning {
  color: var(--accent);
}

.site-footer {
  width: min(100%, 520px);
  display: grid;
  gap: 4px;
  margin: 0 auto;
  padding: 0 16px 28px;
  color: var(--muted);
  text-align: center;
}

.site-footer strong {
  color: var(--green);
  font-size: 13px;
}

.site-footer span {
  font-size: 11px;
  font-weight: 700;
}

.liuyao-result .result-actions {
  display: grid;
  grid-template-columns: 82px 1fr 68px;
}

.liuyao-result .result-actions h2 {
  text-align: center;
}

.liuyao-result .result-actions .text-button {
  min-width: 0;
  height: 36px;
  padding: 0 8px;
  background: #fffdf9;
  color: var(--ink);
}

.liuyao-result-title {
  display: grid;
  gap: 5px;
  padding: 16px 14px 6px;
  text-align: center;
}

.liuyao-result-title strong {
  color: var(--accent-strong);
  font-size: 24px;
}

.liuyao-result-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.result-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  margin: 10px 12px 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #fffdf9;
}

.result-meta-grid div {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.result-meta-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.result-meta-grid strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.35;
}

.coin-panel-head,
.manual-coin-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.coin-panel-head span,
.manual-coin-head span {
  font-size: 13px;
  font-weight: 900;
}

.coin-panel-head small,
.manual-coin-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.coin,
.coin-mini {
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-weight: 900;
}

.coin {
  aspect-ratio: 1;
  border: 2px solid var(--line);
  background: #f6ead8;
  color: var(--ink);
  font-size: 20px;
  box-shadow: inset 0 -6px 0 rgba(69, 46, 26, 0.08);
}

.coin.is-yang {
  border-color: var(--green);
  background: #e3efe8;
  color: var(--green);
}

.coin.is-yin {
  border-color: #d5ac7c;
  background: #faead8;
  color: #8b4a19;
}

.coin.is-empty {
  color: var(--muted);
}

.manual-coin-entry,
.manual-line-entry {
  display: grid;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.manual-coin-controls,
.head-count-controls,
.line-value-controls {
  display: grid;
  gap: 8px;
}

.manual-coin-row,
.head-count-row,
.line-value-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}

.manual-coin-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.coin-toggle,
.head-count-toggle,
.segments {
  display: grid;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.coin-toggle {
  grid-template-columns: 1fr 1fr;
  min-height: 38px;
}

.head-count-toggle {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 38px;
}

.line-value-toggle {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  overflow: hidden;
}

.coin-choice,
.segment {
  border: 0;
  border-right: 1px solid var(--line);
  background: #fffdf9;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.coin-choice:last-child,
.segment:last-child {
  border-right: 0;
}

.coin-choice.is-active,
.coin-choice.is-active.yang,
.segment.is-active {
  background: var(--green);
  color: white;
}

.coin-choice.is-active.yin {
  background: var(--accent);
  color: #fffaf1;
}

.line-choice {
  font-size: 12px;
}

.coin-mini-set {
  display: flex;
  gap: 4px;
}

.coin-mini {
  width: 24px;
  height: 24px;
  background: #f0e6d8;
  color: var(--ink);
  font-size: 12px;
}

.coin-mini.is-yang {
  background: #e3efe8;
  color: var(--green);
}

.coin-mini.is-yin {
  background: #faead8;
  color: #8b4a19;
}

.hex-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.hex-summary div {
  display: grid;
  gap: 3px;
  min-height: 76px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8f0e4;
}

.hex-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.hex-summary strong {
  font-size: 22px;
}

.hex-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.hexagram-pair {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  background: #fffdf9;
}

.hex-chart-head,
.hex-line-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 8px;
  align-items: center;
}

.hex-chart-head {
  padding: 0 8px 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.hex-lines {
  display: grid;
  gap: 7px;
}

.hex-line-row {
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f8f0e4;
}

.hex-line-row.is-moving {
  border-color: rgba(159, 63, 47, 0.36);
  background: #fbecdf;
}

.hex-spirit-cell {
  display: grid;
  gap: 2px;
}

.hex-spirit-cell strong {
  color: var(--accent);
  font-size: 15px;
}

.hex-spirit-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.hex-line-cell {
  display: grid;
  gap: 5px;
}

.line-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  min-height: 20px;
}

.line-meta strong {
  color: var(--ink);
  font-size: 14px;
}

.line-meta span {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.line-meta b,
.line-chip {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: #e3efe8;
  color: var(--green);
  font-size: 11px;
}

.line-chip {
  background: #f0e6d8;
  color: var(--accent);
}

.fly-hidden-list {
  display: grid;
  gap: 3px;
}

.fly-hidden-pair {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.35;
}

.fly-hidden-pair b,
.fly-hidden-pair em {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  min-height: 18px;
  border-radius: 999px;
  font-style: normal;
  font-size: 10px;
  line-height: 1;
}

.fly-hidden-pair b {
  background: #fbecdf;
  color: var(--accent);
}

.fly-hidden-pair em {
  margin-left: 4px;
  background: #e3efe8;
  color: var(--green);
}

.line-drawing {
  display: grid;
  grid-template-columns: minmax(54px, 1fr) 24px;
  gap: 6px;
  align-items: center;
}

.line-symbol {
  height: 18px;
  display: grid;
  align-items: center;
}

.line-symbol.yang::before,
.line-symbol.yin::before,
.line-symbol.yin::after {
  content: "";
  height: 10px;
  border-radius: 2px;
  background: var(--ink);
}

.line-symbol.yang::before {
  width: 100%;
}

.line-symbol.yin {
  grid-template-columns: 1fr 24px 1fr;
}

.line-symbol.yin::before {
  grid-column: 1;
}

.line-symbol.yin::after {
  grid-column: 3;
}

.moving-mark {
  color: var(--accent);
  font-weight: 900;
  text-align: center;
}

.role-badge,
.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  background: #e3efe8;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.tag.is-empty {
  padding: 0;
  background: transparent;
  color: var(--muted);
}

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

@media (max-width: 360px) {
  .date-grid,
  .time-grid {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-input-grid.time-grid {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-input-grid.time-grid .secondary-button {
    grid-column: 1 / -1;
  }

  .hex-chart-head,
  .hex-line-row {
    grid-template-columns: 42px minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 6px;
  }

  .line-meta strong {
    font-size: 13px;
  }
}

.liuyao-result .result-actions {
  grid-template-columns: 82px minmax(0, 1fr) 92px;
}

.liuyao-result .result-actions button {
  white-space: nowrap;
}
/* Public edition — visual system and motion */
:root {
  --bg: #f6f6f2;
  --surface: rgba(255, 255, 252, 0.92);
  --surface-solid: #fffffc;
  --surface-soft: #f1f3ef;
  --ink: #20231f;
  --muted: #70756e;
  --line: rgba(32, 35, 31, 0.11);
  --line-strong: rgba(32, 35, 31, 0.18);
  --accent: #a84a3c;
  --accent-strong: #8f3d33;
  --accent-soft: #f4e7e2;
  --green: #355e52;
  --green-strong: #294a41;
  --green-soft: #e7eeeb;
  --shadow-sm: 0 1px 2px rgba(28, 34, 29, 0.03), 0 10px 28px rgba(28, 34, 29, 0.045);
  --shadow-lg: 0 26px 72px rgba(28, 34, 29, 0.13);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 88% 4%, rgba(53, 94, 82, 0.075), transparent 36rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  opacity: 0.12;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(53, 66, 58, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 66, 58, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}

button,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

.brand-seal span {
  display: block;
  height: 5px;
  border-radius: 999px;
  background: currentColor;
}

.brand-seal span:nth-child(2) {
  background: linear-gradient(90deg, currentColor 0 42%, transparent 42% 58%, currentColor 58%);
}

.app-shell {
  width: min(100%, 1160px);
  padding: 28px clamp(16px, 3vw, 36px) 64px;
}

.topbar,
.liuyao-web-topbar {
  display: grid;
  gap: 24px;
  min-height: 0;
  padding: 32px 0 30px;
}

.brand-lockup {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.brand-seal {
  flex: 0 0 auto;
  display: grid;
  gap: 5px;
  width: 58px;
  height: 58px;
  padding: 13px 10px;
  border: 1px solid rgba(53, 94, 82, 0.18);
  border-radius: 17px;
  background: rgba(255, 255, 252, 0.74);
  color: var(--green);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px);
}

.brand-seal span {
  height: 5px;
}

.eyebrow {
  margin: 1px 0 8px;
  color: var(--green);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1 {
  max-width: none;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(34px, 5vw, 52px);
  font-weight: 650;
  letter-spacing: 0.015em;
  line-height: 1.12;
}

h2 {
  font-size: 17px;
  letter-spacing: 0.01em;
}

.hero-copy {
  max-width: 42rem;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-left: 76px;
}

.hero-badges span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 252, 0.66);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  backdrop-filter: blur(14px);
}

.panel,
.result-panel,
.history-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(20px);
}

.panel {
  gap: 18px;
  padding: clamp(20px, 3vw, 30px);
}

.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-heading.section-divider {
  margin-top: 7px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.section-heading > div {
  display: grid;
  gap: 3px;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.step-index {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--green-soft);
  color: var(--green-strong);
  font-family: "Songti SC", "STSong", serif;
  font-size: 16px;
  font-weight: 800;
}

.field {
  gap: 8px;
}

.field > span {
  color: #5f655e;
  font-size: 12px;
  font-weight: 750;
}

input[type="text"],
input[type="number"],
select {
  height: 48px;
  border-color: var(--line-strong);
  border-radius: 12px;
  background-color: rgba(255, 255, 252, 0.88);
  padding-inline: 14px;
  transition: border-color 160ms ease, box-shadow 180ms ease, background-color 160ms ease;
}

input[type="text"]::placeholder {
  color: #979c95;
}

input:focus,
select:focus {
  border-color: rgba(53, 94, 82, 0.72);
  background-color: #fff;
  box-shadow: 0 0 0 4px rgba(53, 94, 82, 0.1);
}

.segmented,
.segments,
.line-value-toggle,
.coin-toggle,
.head-count-toggle {
  border-color: var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.segmented {
  min-height: 48px;
  padding: 4px;
}

.segmented label {
  border-radius: 9px;
  transition: background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
  cursor: pointer;
}

.segmented input:checked + label {
  background: var(--green-strong);
  box-shadow: 0 2px 8px rgba(41, 74, 65, 0.18);
}

.liuyao-time-grid {
  gap: 12px;
}

.liuyao-note {
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(49, 95, 82, 0.12);
  border-radius: 12px;
  background: var(--green-soft);
  line-height: 1.45;
}

.primary-button,
.result-actions button,
.secondary-button,
.text-button,
.coin-choice,
.segment,
.history-item {
  transition:
    transform 120ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    box-shadow 180ms ease,
    opacity 160ms ease;
  touch-action: manipulation;
}

.primary-button,
.result-actions button,
.secondary-button,
.text-button {
  border-radius: 12px;
}

.primary-button {
  height: 52px;
  background: var(--green-strong);
  box-shadow: 0 8px 20px rgba(41, 74, 65, 0.17);
}

.secondary-button {
  min-height: 46px;
  border: 1px solid rgba(53, 94, 82, 0.15);
  background: var(--green-soft);
  color: var(--green-strong);
  box-shadow: none;
}

.text-button {
  border-color: var(--line);
  background: rgba(255, 255, 252, 0.82);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.segmented input:focus-visible + label {
  outline: 3px solid rgba(53, 94, 82, 0.28);
  outline-offset: 3px;
}

button:active:not(:disabled),
.history-item:active {
  transform: scale(0.98);
  transition-duration: 80ms;
}

button:disabled {
  box-shadow: none;
}

.coin-panel {
  gap: 14px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 252, 0.68);
}

.manual-coin-entry,
.manual-line-entry {
  padding: 14px 0;
}

.coin-choice,
.segment {
  min-height: 40px;
  background: rgba(255, 255, 252, 0.86);
}

.coin-choice.is-active,
.coin-choice.is-active.yang,
.segment.is-active {
  background: var(--green);
}

.coin-choice.is-active.yin {
  background: var(--accent);
}

.cast-action {
  gap: 10px;
  padding-top: 2px;
}

#liuyaoInputView {
  align-items: start;
}

.history-panel {
  gap: 16px;
  padding: 20px;
}

.history-head {
  align-items: flex-start;
}

.history-head > div {
  display: grid;
  gap: 2px;
}

.history-head .eyebrow {
  margin: 0;
  font-size: 9px;
}

.history-head small {
  padding-top: 5px;
}

.history-list {
  gap: 9px;
}

.history-empty,
.history-item {
  min-height: 68px;
  padding: 12px;
  border-radius: 13px;
  background: rgba(255, 255, 252, 0.72);
}

.history-item {
  position: relative;
  padding-right: 28px;
}

.history-item::after {
  position: absolute;
  top: 50%;
  right: 12px;
  content: "›";
  color: #a49a90;
  font-size: 22px;
  transform: translateY(-52%);
}

.privacy-note {
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.result-panel {
  margin-top: 0;
}

.liuyao-result .result-actions {
  padding: 16px 20px;
}

.liuyao-result .result-actions .text-button {
  background: rgba(255, 255, 252, 0.76);
}

.liuyao-result-title {
  padding: 30px 18px 12px;
}

.liuyao-result-title strong {
  color: var(--ink);
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(26px, 5vw, 38px);
  letter-spacing: 0.04em;
}

.result-meta-grid {
  overflow: hidden;
  margin: 16px 20px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 252, 0.66);
}

.result-meta-grid div {
  padding: 12px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.hex-summary {
  gap: 10px;
  padding: 20px;
}

.hex-summary div {
  min-height: 88px;
  padding: 14px;
  border-radius: 15px;
  background: var(--surface-soft);
}

.hexagram-pair {
  padding: 20px;
  background: rgba(255, 255, 252, 0.72);
}

.hex-line-row {
  min-height: 64px;
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.modal-backdrop {
  background: rgba(25, 22, 18, 0.18);
  opacity: 0;
  visibility: hidden;
  backdrop-filter: blur(10px);
  transition:
    opacity 180ms var(--ease-standard),
    visibility 180ms step-end;
}

.modal-backdrop.is-open {
  opacity: 1;
  visibility: visible;
  transition:
    opacity 220ms ease,
    visibility 0ms step-start;
}

.modal {
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  transition: opacity 180ms var(--ease-standard), transform 180ms var(--ease-standard);
}

.modal-backdrop.is-open .modal {
  opacity: 1;
  transform: translateY(0) scale(1);
  transition: opacity 220ms ease, transform 260ms var(--ease-out);
}

.calendar-modal {
  padding: 0;
}

.calendar-panel {
  width: min(100%, 560px);
  padding: 22px;
  border-radius: 24px 24px 0 0;
  background: var(--surface-solid);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(100%);
  transition: opacity 200ms var(--ease-standard), transform 200ms var(--ease-standard);
}

.calendar-modal.is-open .calendar-panel {
  opacity: 1;
  transform: translateY(0);
  transition: opacity 220ms ease, transform 320ms var(--ease-out);
}

.calendar-timezone,
.calendar-result div {
  border-radius: 12px;
  background: var(--surface-soft);
}

.liuyao-view.is-entering {
  animation: viewEnter 240ms var(--ease-out) both;
}

.site-footer {
  width: min(100%, 1160px);
  padding: 0 16px 36px;
}

@keyframes viewEnter {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (hover: hover) and (pointer: fine) {
  .primary-button:hover:not(:disabled),
  .result-actions button:hover:not(:disabled) {
    background: #223e36;
    box-shadow: 0 10px 24px rgba(41, 74, 65, 0.22);
  }

  .secondary-button:hover:not(:disabled) {
    background: #dce8e3;
    color: #223e36;
    box-shadow: none;
  }

  .text-button:hover:not(:disabled),
  .history-item:hover {
    border-color: var(--line-strong);
    background: #fff;
    box-shadow: 0 8px 20px rgba(42, 30, 18, 0.07);
  }

  .coin-choice:hover:not(.is-active),
  .segment:hover:not(.is-active) {
    background: #ecefea;
    color: var(--ink);
  }
}

@media (min-width: 720px) {
  .topbar,
  .liuyao-web-topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    padding-top: 46px;
  }

  .hero-badges {
    justify-content: flex-end;
    padding-left: 0;
  }

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

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

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

@media (min-width: 940px) {
  #liuyaoInputView {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 22px;
  }

  .history-panel {
    position: sticky;
    top: 24px;
    max-height: calc(100vh - 48px);
    overflow: auto;
  }

  .result-panel {
    width: 100%;
  }

  .calendar-modal {
    place-items: center;
    padding: 24px;
  }

  .calendar-panel {
    border-radius: 24px;
    transform: translateY(18px) scale(0.985);
  }

  .calendar-modal.is-open .calendar-panel {
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 600px) {
  .app-shell {
    padding-top: 10px;
    padding-bottom: 40px;
  }

  .topbar,
  .liuyao-web-topbar {
    gap: 18px;
    padding: 22px 2px 24px;
  }

  .brand-lockup {
    gap: 13px;
  }

  .brand-seal {
    width: 48px;
    height: 48px;
    padding: 11px 9px;
    border-radius: 14px;
  }

  .hero-copy {
    font-size: 13px;
  }

  .hero-badges {
    padding-left: 61px;
  }

  .panel,
  .result-panel,
  .history-panel {
    border-radius: 20px;
  }

  .section-heading p {
    max-width: 22rem;
  }

  .coin-panel-head,
  .manual-coin-head {
    align-items: flex-start;
  }

  .manual-coin-head small {
    max-width: 10rem;
    text-align: right;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .calendar-modal {
    padding: 0;
  }

  .modal {
    border-radius: 20px;
  }

  .result-meta-grid {
    margin-inline: 12px;
  }

  .hex-summary,
  .hexagram-pair {
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .liuyao-view.is-entering {
    animation: none !important;
  }

  .modal,
  .calendar-panel,
  .modal-backdrop.is-open .modal,
  .calendar-modal.is-open .calendar-panel {
    transform: none !important;
  }

  .modal-backdrop,
  .modal,
  .calendar-panel {
    transition: opacity 120ms linear, visibility 120ms step-end !important;
  }

  button,
  .history-item {
    transform: none !important;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .panel,
  .result-panel,
  .history-panel,
  .brand-seal,
  .hero-badges span,
  .modal-backdrop,
  .modal {
    backdrop-filter: none;
  }

  .panel,
  .result-panel,
  .history-panel,
  .brand-seal,
  .hero-badges span {
    background: var(--surface-solid);
  }
}

@media (prefers-contrast: more) {
  :root {
    --line: rgba(32, 35, 31, 0.3);
    --line-strong: rgba(32, 35, 31, 0.48);
  }

  .panel,
  .result-panel,
  .history-panel,
  input,
  select {
    background: var(--surface-solid);
  }
}

/* Feedback revision — direct entry, compact calendar, reader-first plate */
.app-shell {
  padding-top: clamp(14px, 2.5vw, 28px);
}

.liuyao-result-title {
  gap: 4px;
  padding: 22px 20px 14px;
  text-align: left;
}

.liuyao-result-title > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: 0.12em;
}

.liuyao-result-title strong {
  font-size: clamp(25px, 4vw, 34px);
  line-height: 1.2;
}

.liuyao-result-title small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.result-context-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(96px, 1fr);
  gap: 8px;
  margin: 0 20px 16px;
}

.result-context-grid > div,
.record-detail-grid > div {
  display: grid;
  align-content: start;
  gap: 4px;
  min-width: 0;
  min-height: 58px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

.result-context-grid span,
.record-detail-grid span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.result-context-grid strong,
.record-detail-grid strong {
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.45;
}

.hexagram-pair {
  gap: 10px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  background: rgba(255, 255, 252, 0.76);
}

.professional-plate-head {
  display: grid;
  grid-template-columns: 48px minmax(0, 1.2fr) minmax(0, 0.95fr);
  gap: 8px;
  align-items: stretch;
}

.plate-direction,
.plate-hex-heading {
  display: grid;
  align-content: start;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-soft);
}

.plate-direction {
  padding-inline: 6px;
  text-align: center;
}

.plate-direction span,
.plate-hex-heading > span,
.moving-summary > span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.06em;
}

.plate-direction small,
.plate-hex-heading small,
.moving-summary small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.35;
}

.plate-hex-heading strong {
  overflow-wrap: anywhere;
  font-family: "Songti SC", "STSong", serif;
  font-size: clamp(16px, 2.5vw, 21px);
  line-height: 1.25;
}

.moving-summary {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid rgba(168, 74, 60, 0.16);
  border-radius: 10px;
  background: var(--accent-soft);
}

.moving-summary strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.hex-chart-head {
  padding-top: 2px;
}

.hex-line-row {
  border-radius: 9px;
  background: rgba(241, 243, 239, 0.8);
}

.record-details {
  margin: 0 20px 20px;
  border-top: 1px solid var(--line);
}

.record-details summary {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  list-style: none;
}

.record-details summary::-webkit-details-marker {
  display: none;
}

.record-details summary::after {
  content: "＋";
  color: var(--green);
  font-size: 16px;
  transition: transform 180ms var(--ease-out);
}

.record-details[open] summary::after {
  transform: rotate(45deg);
}

.record-detail-grid {
  display: grid;
  gap: 8px;
  padding-bottom: 4px;
}

.ai-reading-panel {
  display: grid;
  gap: 16px;
  margin: 0 20px 20px;
  padding: 20px;
  border: 1px solid rgba(53, 94, 82, 0.14);
  border-radius: 18px;
  background: var(--green-soft);
}

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

.ai-reading-head > div {
  display: grid;
  gap: 4px;
}

.ai-reading-kicker {
  color: var(--green);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.16em;
}

.ai-reading-head h3 {
  margin: 0;
  color: var(--ink);
  font-family: "Songti SC", "STSong", serif;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.ai-reading-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.ai-state-badge {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(53, 94, 82, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 252, 0.72);
  color: var(--green-strong);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.ai-state-badge.is-ready {
  background: var(--green-strong);
  color: white;
}

.ai-start-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  align-items: end;
  gap: 10px;
}

.ai-access-field input[type="password"] {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: rgba(255, 255, 252, 0.9);
  color: var(--ink);
  padding: 0 14px;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 180ms ease, background-color 160ms ease;
}

.ai-access-field input[type="password"]:focus {
  border-color: rgba(53, 94, 82, 0.72);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(53, 94, 82, 0.1);
}

.ai-start-row .primary-button {
  width: 100%;
  margin: 0;
}

.ai-data-note {
  margin: -4px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.ai-status {
  min-height: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.ai-status:empty {
  display: none;
}

.ai-status.is-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-strong);
  font-weight: 750;
}

.ai-status.is-loading::before {
  width: 14px;
  height: 14px;
  flex: 0 0 auto;
  border: 2px solid rgba(53, 94, 82, 0.2);
  border-top-color: var(--green);
  border-radius: 50%;
  content: "";
  animation: aiSpin 720ms linear infinite;
}

.ai-status.is-error {
  padding: 10px 12px;
  border: 1px solid rgba(168, 74, 60, 0.18);
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 700;
}

.ai-chat {
  display: grid;
  gap: 12px;
  max-height: min(64vh, 720px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 2px;
  scroll-behavior: smooth;
}

.ai-message {
  display: grid;
  gap: 7px;
  max-width: 94%;
  padding: 13px 14px;
  border-radius: 15px;
  line-height: 1.72;
}

.ai-message.is-assistant {
  border: 1px solid var(--line);
  border-bottom-left-radius: 5px;
  background: rgba(255, 255, 252, 0.94);
  color: var(--ink);
}

.ai-message.is-user {
  justify-self: end;
  max-width: 84%;
  border-bottom-right-radius: 5px;
  background: var(--green-strong);
  color: white;
}

.ai-message-label {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.ai-message.is-user .ai-message-label {
  color: rgba(255, 255, 255, 0.68);
}

.ai-message-content {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
  font-size: 14px;
}

.ai-question-form,
.ai-question-form label {
  display: grid;
  gap: 9px;
}

.ai-question-form label > span {
  color: #5f655e;
  font-size: 12px;
  font-weight: 750;
}

.ai-question-form textarea {
  width: 100%;
  min-height: 92px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  background: rgba(255, 255, 252, 0.92);
  color: var(--ink);
  padding: 12px 14px;
  font: inherit;
  line-height: 1.55;
  outline: none;
  transition: border-color 160ms ease, box-shadow 180ms ease, background-color 160ms ease;
}

.ai-question-form textarea:focus {
  border-color: rgba(53, 94, 82, 0.72);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(53, 94, 82, 0.1);
}

.ai-chat-actions {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 8px;
}

.ai-chat-actions button {
  width: 100%;
  min-height: 46px;
  margin: 0;
}

@keyframes aiSpin {
  to {
    transform: rotate(360deg);
  }
}

.calendar-panel {
  max-height: min(92dvh, 760px);
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  gap: 12px;
  padding-bottom: max(18px, env(safe-area-inset-bottom));
}

.calendar-panel-head {
  flex: 0 0 auto;
}

.calendar-panel-head .text-button {
  min-width: 58px;
  min-height: 44px;
}

.calendar-panel-content {
  min-height: 0;
  display: grid;
  gap: 12px;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 2px 2px 4px;
  scrollbar-gutter: stable;
}

.calendar-result {
  gap: 6px;
  padding-top: 0;
}

.calendar-result div {
  min-height: 48px;
  padding: 7px 8px;
}

.calendar-result strong {
  font-size: 13px;
  line-height: 1.35;
}

.calendar-apply-button {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  width: 100%;
  margin: 0;
}

@media (min-width: 720px) {
  .result-context-grid {
    grid-template-columns: minmax(0, 2fr) minmax(100px, 0.9fr) minmax(0, 2fr) minmax(100px, 0.9fr);
  }

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

@media (max-width: 600px) {
  .app-shell {
    padding-top: 10px;
  }

  .panel,
  .result-panel {
    border-radius: 18px;
  }

  .liuyao-result .result-actions {
    padding: 12px;
  }

  .liuyao-result-title {
    padding: 20px 14px 12px;
  }

  .result-context-grid {
    margin-inline: 12px;
  }

  .hexagram-pair {
    padding: 12px;
  }

  .record-details {
    margin-inline: 12px;
  }

  .ai-reading-panel {
    margin-inline: 12px;
    padding: 16px 14px;
  }

  .ai-reading-head {
    gap: 10px;
  }

  .ai-start-row {
    grid-template-columns: 1fr;
  }

  .ai-chat-actions {
    grid-template-columns: 1fr 1fr;
  }

  #deepseekSendButton {
    grid-row: 1;
    grid-column: 1 / -1;
  }

  .calendar-panel {
    width: 100%;
    max-height: 94dvh;
    padding: 16px 14px max(12px, env(safe-area-inset-bottom));
    border-radius: 22px 22px 0 0;
  }

  .calendar-input-grid.time-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 78px;
  }
}

@media (max-width: 360px) {
  .professional-plate-head {
    grid-template-columns: 42px minmax(0, 1fr) minmax(0, 0.9fr);
    gap: 6px;
  }

  .plate-direction,
  .plate-hex-heading {
    padding: 8px 6px;
  }

  .calendar-input-grid.time-grid {
    grid-template-columns: 1fr 1fr;
  }

  .calendar-input-grid.time-grid .secondary-button {
    grid-column: 1 / -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .record-details summary::after {
    transition: none;
  }

  .ai-status.is-loading::before {
    animation: none;
  }

  .ai-chat {
    scroll-behavior: auto;
  }
}
