:root {
  --ink: #17353b;
  --ink-soft: #577075;
  --paper: #f3f6f3;
  --card: #fffefb;
  --line: #e0e7e2;
  --teal: #3f827d;
  --teal-dark: #245f60;
  --teal-pale: #e6f0eb;
  --coral: #d9775f;
  --coral-pale: #fbebe4;
  --amber: #e5a65e;
  --shadow: 0 12px 36px rgba(35, 65, 61, .055);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body { margin: 0; color: var(--ink); font-family: 'Segoe UI', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, a:focus-visible { outline: 3px solid rgba(63, 130, 125, .28); outline-offset: 3px; }
button:disabled { cursor: not-allowed; opacity: .58; }
a { color: inherit; text-decoration: none; }
svg { display: block; }
.svg-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
[hidden] { display: none !important; }

.app-shell { width: min(1540px, calc(100% - 64px)); margin: 0 auto; }
.topbar { min-height: 98px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 13px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--ink); box-shadow: 0 6px 16px rgba(23, 53, 59, .14); }
.brand-mark svg { width: 25px; height: 25px; fill: none; stroke: #f5c382; stroke-width: 1.8; stroke-linecap: round; }
.brand-copy { display: flex; flex-direction: column; gap: 3px; }
.brand-copy strong { font-size: 20px; letter-spacing: .04em; font-weight: 700; }
.brand-copy strong span { color: var(--coral); padding: 0 5px; }
.brand-copy small { color: #82918f; font-size: 9px; font-weight: 600; letter-spacing: .21em; }
.header-actions { display: flex; align-items: center; gap: 18px; }
.connection-pill { display: inline-flex; align-items: center; gap: 7px; color: #748783; font-size: 12px; }
.connection-pill i { width: 6px; height: 6px; border-radius: 50%; background: #d4a360; box-shadow: 0 0 0 4px rgba(212, 163, 96, .1); }
.connection-pill.online i { background: #54a087; box-shadow: 0 0 0 4px rgba(84, 160, 135, .12); }
.connection-pill.offline i { background: var(--coral); box-shadow: 0 0 0 4px rgba(217, 119, 95, .12); }
.class-switch { display: flex; align-items: center; gap: 10px; padding: 7px 12px 7px 7px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.7); cursor: pointer; font-size: 13px; font-weight: 600; transition: .2s; }
.class-switch:hover { border-color: #bdcec6; background: white; }
.class-switch > svg { width: 15px; height: 15px; fill: none; stroke: #879490; stroke-width: 1.8; }
.class-avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--teal-pale); color: var(--teal-dark); font-size: 12px; }

.presence-bar { display: flex; align-items: center; gap: 22px; min-height: 66px; padding: 10px 16px 10px 22px; margin-bottom: 20px; border: 1px solid rgba(218, 228, 220, .85); border-radius: 19px; background: rgba(255, 255, 252, .64); }
.presence-heading { flex: 0 0 auto; display: flex; align-items: center; gap: 8px; padding-right: 22px; border-right: 1px solid var(--line); font-size: 12px; font-weight: 600; }
.presence-heading small { margin-left: 2px; color: #91a09b; font-size: 8px; letter-spacing: .15em; }
.live-dot { width: 7px; height: 7px; border-radius: 50%; background: #65a58f; box-shadow: 0 0 0 4px rgba(101,165,143,.12); }
.presence-list { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.presence-card { min-width: 0; display: flex; align-items: center; gap: 12px; padding: 7px 12px; border-radius: 12px; transition: background .25s; }
.presence-card.self { background: #eef4ef; }
.presence-class { flex: 1; min-width: 92px; display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.presence-class i { width: 6px; height: 6px; flex: 0 0 auto; border-radius: 50%; background: #b6c0bc; }
.presence-card.active .presence-class i { background: #55a188; box-shadow: 0 0 0 3px rgba(85,161,136,.12); }
.presence-metrics { display: flex; align-items: center; gap: 20px; }
.presence-metric { display: flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.presence-metric small { color: #8a9894; font-size: 10px; }
.presence-metric strong { min-width: 28px; font-size: 14px; font-variant-numeric: tabular-nums; }
.presence-metric strong em { margin-left: 2px; color: #8a9894; font-size: 9px; font-style: normal; font-weight: 500; }
.presence-state { min-width: 44px; color: #94a09d; font-size: 10px; text-align: right; }
.presence-card.active .presence-state { color: var(--teal); }

.dashboard { display: grid; grid-template-columns: minmax(370px, .82fr) minmax(540px, 1.55fr); gap: 20px; align-items: stretch; }
.control-column { min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.panel { border: 1px solid rgba(218, 227, 220, .9); border-radius: var(--radius); background: var(--card); box-shadow: var(--shadow); }
.voice-panel { padding: 25px 28px 22px; }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.eyebrow { display: block; margin-bottom: 7px; color: #879690; font-size: 9px; font-weight: 600; letter-spacing: .17em; text-transform: uppercase; }
h1, h2, p { margin: 0; }
h1 { font-size: 22px; font-weight: 600; letter-spacing: .02em; }
h2 { font-size: 22px; font-weight: 600; letter-spacing: .02em; }
.sound-status { display: inline-flex; align-items: center; gap: 6px; margin-top: 3px; padding: 6px 10px; border-radius: 99px; background: #f0f2ef; color: #87938f; font-size: 10px; white-space: nowrap; transition: .25s; }
.sound-status i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.sound-status.status-good { background: var(--teal-pale); color: var(--teal-dark); }
.sound-status.status-warm { background: #faf0df; color: #b67b35; }
.sound-status.status-loud { background: var(--coral-pale); color: #be634f; }

.volume-gauge { position: relative; width: min(290px, 90%); height: 182px; margin: 5px auto 0; }
.volume-gauge > svg { width: 100%; height: 100%; overflow: visible; }
.gauge-track, .gauge-progress { fill: none; stroke-width: 11; stroke-linecap: round; }
.gauge-track { stroke: #edf0eb; }
.gauge-progress { stroke: url(#gaugeGradient); stroke-dasharray: 100; stroke-dashoffset: 100; transition: stroke-dashoffset .25s ease-out; }
.gauge-ticks { fill: none; stroke: #cbd5ce; stroke-width: 2; stroke-linecap: round; }
.volume-value { position: absolute; left: 0; right: 0; top: 61px; display: flex; align-items: baseline; justify-content: center; gap: 7px; pointer-events: none; }
.volume-value span { font-size: 66px; line-height: 1; font-weight: 600; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.volume-value small { color: #8b9995; font-size: 15px; font-weight: 500; }
.volume-caption { position: absolute; left: 0; right: 0; bottom: 5px; color: #86938f; font-size: 11px; text-align: center; }
.threshold-area { padding-top: 16px; border-top: 1px solid #edf0ec; }
.threshold-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 11px; }
.threshold-label > span { font-size: 11px; font-weight: 600; }
.threshold-label small { color: #94a09c; font-size: 9px; }
.threshold-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 7px; }
.threshold-options button { position: relative; height: 34px; border: 1px solid #e2e8e3; border-radius: 10px; background: #f8faf7; color: #6f807b; cursor: pointer; font-size: 12px; font-weight: 600; transition: .2s; }
.threshold-options button::after { content: 'dB'; margin-left: 2px; font-size: 8px; font-weight: 400; opacity: .65; }
.threshold-options button:hover:not(:disabled) { border-color: #9bbcaf; color: var(--teal-dark); }
.threshold-options button.active { border-color: var(--teal); background: var(--teal); color: white; box-shadow: 0 4px 12px rgba(63,130,125,.18); }

.timer-panel { flex: 1; padding: 22px 28px 18px; }
.primary-timer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-bottom: 18px; }
.timer-label { display: flex; align-items: center; gap: 11px; font-size: 12px; font-weight: 600; }
.timer-label > span:last-child { display: flex; flex-direction: column; gap: 5px; }
.timer-label small, .secondary-timer small { color: #98a39f; font-size: 9px; font-weight: 400; }
.timer-icon { display: grid; place-items: center; width: 35px; height: 35px; border-radius: 11px; background: var(--teal-pale); color: var(--teal); }
.timer-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; }
.primary-timer time { color: var(--teal-dark); font-size: clamp(32px, 3vw, 44px); line-height: 1; font-weight: 600; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.secondary-timer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid #edf0ec; }
.secondary-timer > span { display: flex; flex-direction: column; gap: 5px; font-size: 11px; font-weight: 500; }
.secondary-timer time { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.microphone-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 7px 10px; align-items: center; margin: 4px 0 12px; padding: 9px 10px; border: 1px solid #e7ece7; border-radius: 12px; background: #f9fbf8; }
.microphone-label { display: inline-flex; align-items: center; gap: 6px; color: #687b76; font-size: 10px; font-weight: 600; white-space: nowrap; }
.microphone-label svg { width: 15px; height: 15px; fill: none; stroke: var(--teal); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.microphone-row select { min-width: 0; height: 30px; padding: 0 26px 0 9px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #526761; font-size: 10px; }
.microphone-row select:enabled { border-color: #dde5df; background: white; cursor: pointer; }
.microphone-row small { grid-column: 1 / -1; color: #98a39f; font-size: 8px; }
.microphone-row small.warning { color: #bf6a55; font-weight: 500; }
.session-actions { display: flex; gap: 9px; margin-top: 5px; }
.start-button { flex: 1; display: grid; grid-template-columns: 24px auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; justify-content: center; padding: 12px 18px; border: 0; border-radius: 14px; background: var(--ink); color: white; cursor: pointer; box-shadow: 0 7px 18px rgba(23,53,59,.15); transition: transform .2s, background .2s; }
.start-button:hover:not(:disabled) { transform: translateY(-1px); background: #23474d; }
.start-button svg { grid-row: 1 / 3; width: 22px; height: 22px; fill: none; stroke: #f2bd7c; stroke-width: 1.7; stroke-linejoin: round; }
.start-button > span { text-align: left; font-size: 13px; font-weight: 600; }
.start-button small { margin-top: 2px; color: #b9cbc9; text-align: left; font-size: 8px; font-weight: 400; }
.end-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; padding: 0 14px; border: 1px solid #e3e8e4; border-radius: 13px; background: white; color: #7d8a86; cursor: pointer; font-size: 10px; }
.end-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.session-actions.running .end-button { flex: 1; min-height: 48px; font-size: 12px; }
.session-actions.running .end-button svg { width: 16px; height: 16px; }
.autosave-note { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 12px; color: #9aa5a0; font-size: 8px; }
.autosave-note > span { width: 5px; height: 5px; border-radius: 50%; background: #7faf9c; }

.voyage-panel { min-width: 0; display: flex; flex-direction: column; padding: 26px 28px 20px; overflow: hidden; }
.voyage-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.voyage-progress-copy { display: flex; align-items: center; gap: 8px; }
.voyage-progress-copy strong { color: var(--teal); font-size: 24px; font-weight: 600; }
.voyage-progress-copy span { max-width: 28px; color: #93a09c; font-size: 9px; line-height: 1.4; }
.sea-scene { position: relative; flex: 1; min-height: 330px; overflow: hidden; border-radius: 18px; background: #dcece7; }
.sea-scene > svg { width: 100%; height: 100%; position: absolute; inset: 0; }
.cloud-one { animation: cloudDrift 16s ease-in-out infinite alternate; }
.cloud-two { animation: cloudDrift 20s ease-in-out infinite alternate-reverse; }
.birds { animation: birdFloat 5s ease-in-out infinite; }
.wave-one { animation: waveMove 8s linear infinite; }
.wave-two { animation: waveMove 12s linear infinite reverse; }
.boat { transition: transform 1.6s cubic-bezier(.22,.8,.3,1); }
.boat > * { transform-box: fill-box; transform-origin: center; }
.sea-scene.running .boat { animation: boatBob 3.4s ease-in-out infinite; }
.scene-message { position: absolute; left: 25px; top: 23px; display: flex; flex-direction: column; pointer-events: none; }
.message-kicker { margin-bottom: 7px; color: #668984; font-size: 8px; font-weight: 600; letter-spacing: .18em; }
.scene-message strong { color: #294f52; font-size: 17px; font-weight: 600; }
.scene-message small { margin-top: 6px; color: #6e8d87; font-size: 9px; }
.milestone-toast { position: absolute; left: 50%; bottom: 22px; display: flex; align-items: center; gap: 8px; padding: 10px 16px; border: 1px solid rgba(255,255,255,.5); border-radius: 99px; background: rgba(255,254,247,.9); color: var(--teal-dark); box-shadow: 0 8px 24px rgba(35,74,71,.12); font-size: 11px; opacity: 0; transform: translate(-50%, 12px); transition: .35s; pointer-events: none; backdrop-filter: blur(8px); white-space: nowrap; }
.milestone-toast.show { opacity: 1; transform: translate(-50%, 0); }
.milestone-toast svg { width: 15px; height: 15px; fill: none; stroke: var(--teal); stroke-width: 2; }
.route-area { position: relative; margin: 23px 8px 16px; }
.route-track { position: absolute; top: 6px; left: 4px; right: 4px; height: 2px; background: #e1e8e2; }
.route-track > div { width: 0; height: 100%; background: var(--teal); transition: width 1s ease; }
.route-stops { position: relative; display: flex; justify-content: space-between; }
.route-stop { display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 50px; color: #9aa6a1; }
.route-stop i { width: 13px; height: 13px; margin-bottom: 2px; border: 3px solid var(--card); border-radius: 50%; background: #dce4de; box-shadow: 0 0 0 1px #dce4de; transition: .35s; }
.route-stop span { font-size: 10px; font-weight: 500; }
.route-stop small { font-size: 8px; }
.route-stop.active { color: var(--teal-dark); }
.route-stop.active i { background: var(--teal); box-shadow: 0 0 0 1px var(--teal), 0 0 0 5px rgba(63,130,125,.09); }
.voyage-footer { display: flex; align-items: center; gap: 20px; padding-top: 14px; border-top: 1px solid #edf0ec; }
.voyage-footer > span { display: flex; align-items: center; gap: 6px; color: #83918d; font-size: 9px; white-space: nowrap; }
.voyage-footer > span strong { color: var(--teal-dark); font-size: 12px; }
.energy-dot { width: 7px; height: 7px; border-radius: 50%; background: #e8b46e; box-shadow: 0 0 0 3px #faf0df; }
.voyage-footer p { flex: 1; color: #98a39f; font-size: 9px; text-align: center; }
.voyage-footer button { display: inline-flex; align-items: center; gap: 6px; padding: 6px 0; border: 0; background: transparent; color: #6f817c; cursor: pointer; font-size: 10px; }
.voyage-footer button:hover { color: var(--teal); }
.voyage-footer button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.footer { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 82px; color: #96a29e; font-size: 10px; }
.footer a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 15px; border: 1px solid #d5e0da; border-radius: 12px; background: rgba(255,255,252,.78); color: #466e67; font-size: 13px; font-weight: 600; box-shadow: 0 4px 14px rgba(40,72,66,.045); transition: .2s; }
.footer a:hover { border-color: #91b5a9; background: white; color: var(--teal-dark); transform: translateY(-1px); }
.footer a svg { width: 15px; height: 15px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.modal-backdrop, .drawer-backdrop { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; background: rgba(19, 43, 45, .38); backdrop-filter: blur(8px); animation: fadeIn .2s ease; }
.modal { position: relative; width: min(480px, 100%); padding: 38px; border: 1px solid rgba(255,255,255,.7); border-radius: 26px; background: #fffefb; box-shadow: 0 30px 90px rgba(21,47,48,.2); text-align: center; animation: modalIn .3s ease; }
.modal-close { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid #e4e9e4; border-radius: 11px; background: #fafbf8; color: #83908c; cursor: pointer; }
.modal > .modal-close { position: absolute; right: 18px; top: 18px; }
.modal-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.modal-symbol { display: grid; place-items: center; width: 60px; height: 60px; margin: 0 auto 20px; border-radius: 19px; background: var(--ink); }
.modal-symbol svg { width: 30px; height: 30px; fill: none; stroke: #f1bb78; stroke-width: 1.6; stroke-linecap: round; }
.modal-symbol.small { width: 50px; height: 50px; border-radius: 16px; background: var(--coral-pale); }
.modal-symbol.small svg { width: 23px; height: 23px; stroke: var(--coral); }
.modal h2 { font-size: 24px; }
.modal > p { margin: 11px auto 24px; color: #82908c; font-size: 12px; line-height: 1.8; }
.class-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.class-option { position: relative; padding: 20px 12px; border: 1px solid #dfe7e0; border-radius: 16px; background: #f8faf6; cursor: pointer; transition: .2s; }
.class-option:hover { transform: translateY(-2px); border-color: #8eb2a4; background: #f0f6f1; box-shadow: 0 8px 20px rgba(52,91,79,.08); }
.class-option strong { display: block; margin-bottom: 5px; font-size: 18px; }
.class-option small { color: #8b9994; font-size: 10px; }
.class-option .selected-mark { position: absolute; right: 9px; top: 9px; display: none; width: 18px; height: 18px; border-radius: 50%; background: var(--teal); color: white; }
.class-option .selected-mark svg { width: 12px; height: 12px; margin: 3px; fill: none; stroke: currentColor; stroke-width: 2; }
.class-option.selected .selected-mark { display: block; }
.modal-note { margin-top: 20px; color: #a0aaa6; font-size: 9px; }
.confirm-modal { width: min(400px, 100%); padding: 32px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.confirm-actions button { padding: 12px; border-radius: 12px; cursor: pointer; font-size: 12px; }
.button-secondary { border: 1px solid #dfe6e0; background: white; }
.button-primary { border: 1px solid var(--ink); background: var(--ink); color: white; }

.drawer-backdrop { justify-items: end; padding: 0; }
.history-drawer { width: min(570px, 100%); height: 100%; padding: 30px; overflow-y: auto; background: #f8faf6; box-shadow: -20px 0 70px rgba(21,47,48,.14); animation: drawerIn .3s ease; }
.drawer-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.drawer-header h2 { font-size: 24px; }
.history-filters { display: flex; gap: 7px; margin-bottom: 22px; padding: 4px; border-radius: 13px; background: #edf1eb; }
.history-filters button { flex: 1; padding: 9px 8px; border: 0; border-radius: 10px; background: transparent; color: #7b8a85; cursor: pointer; font-size: 11px; }
.history-filters button.active { background: white; color: var(--ink); box-shadow: 0 2px 8px rgba(30,55,51,.06); font-weight: 600; }
.history-date { display: flex; align-items: center; gap: 10px; margin: 22px 0 10px; color: #85938e; font-size: 10px; }
.history-date::after { content: ''; flex: 1; height: 1px; background: #e1e7e1; }
.history-card { padding: 18px; border: 1px solid #e0e7df; border-radius: 17px; background: white; box-shadow: 0 5px 18px rgba(38,67,60,.035); }
.history-card + .history-card { margin-top: 10px; }
.history-card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.history-class { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 600; }
.history-class span { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: var(--teal-pale); color: var(--teal-dark); font-size: 10px; }
.history-save-state { padding: 4px 7px; border-radius: 6px; background: #f1f3ef; color: #93a09a; font-size: 8px; }
.history-metrics { display: grid; grid-template-columns: 1.2fr 1.2fr 1fr; gap: 10px; }
.history-metric { display: flex; flex-direction: column; gap: 5px; }
.history-metric small { color: #96a29d; font-size: 8px; }
.history-metric strong { font-size: 18px; font-weight: 600; font-variant-numeric: tabular-nums; }
.history-metric strong em { margin-left: 2px; color: #87958f; font-size: 9px; font-style: normal; font-weight: 400; }
.history-card-bottom { display: flex; justify-content: space-between; gap: 12px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #eef1ec; color: #8c9994; font-size: 9px; }
.history-card-bottom strong { color: var(--teal); font-weight: 500; }
.empty-state { display: flex; flex-direction: column; align-items: center; padding: 80px 20px; color: #95a19c; text-align: center; }
.empty-state svg { width: 38px; height: 38px; margin-bottom: 16px; fill: none; stroke: #a8b8b0; stroke-width: 1.3; }
.empty-state strong { margin-bottom: 8px; color: #637872; font-size: 14px; }
.empty-state span { font-size: 10px; }
.loading-state { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 80px 0; color: #8e9c96; font-size: 11px; }
.loading-state i { width: 16px; height: 16px; border: 2px solid #dce5df; border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; }
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 100; max-width: calc(100% - 40px); padding: 12px 20px; border-radius: 12px; background: var(--ink); color: white; box-shadow: 0 12px 35px rgba(23,53,59,.22); font-size: 12px; opacity: 0; transform: translate(-50%, 15px); transition: .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@keyframes cloudDrift { to { transform: translateX(22px); } }
@keyframes birdFloat { 50% { transform: translateY(-5px); } }
@keyframes waveMove { to { transform: translateX(160px); } }
@keyframes boatBob { 0%,100% { translate: 0 0; rotate: -1deg; } 50% { translate: 0 -5px; rotate: 1deg; } }
@keyframes fadeIn { from { opacity: 0; } }
@keyframes modalIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes drawerIn { from { transform: translateX(100%); } }
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 1500px) {
  .voice-panel { padding-top: 28px; }
  .volume-gauge { height: 196px; }
  .sea-scene { min-height: 410px; }
}

@media (max-width: 1100px) {
  .app-shell { width: min(960px, calc(100% - 36px)); }
  .dashboard { grid-template-columns: minmax(330px, .9fr) minmax(420px, 1.2fr); }
  .voice-panel, .timer-panel, .voyage-panel { padding-left: 20px; padding-right: 20px; }
  .presence-metrics { gap: 10px; }
  .sea-scene { min-height: 350px; }
  .voyage-footer p { display: none; }
  .voyage-footer { justify-content: space-between; }
}

@media (max-width: 850px) {
  .dashboard { grid-template-columns: 1fr; }
  .control-column { display: grid; grid-template-columns: 1fr 1fr; align-items: stretch; }
  .sea-scene { min-height: 390px; }
  .presence-bar { gap: 8px; padding-left: 14px; }
  .presence-heading { padding-right: 12px; }
  .presence-heading small { display: none; }
  .presence-metrics { gap: 8px; }
  .presence-state { display: none; }
}

@media (max-width: 650px) {
  .app-shell { width: calc(100% - 24px); }
  .topbar { min-height: 80px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { font-size: 7px; }
  .brand-mark { width: 38px; height: 38px; border-radius: 12px; }
  .connection-pill { display: none; }
  .class-switch { font-size: 11px; }
  .presence-bar { display: block; padding: 12px; }
  .presence-heading { margin-bottom: 8px; padding: 0 0 8px; border-right: 0; border-bottom: 1px solid var(--line); }
  .presence-list { gap: 4px; }
  .presence-card { display: block; padding: 8px; }
  .presence-class { margin-bottom: 5px; font-size: 11px; }
  .presence-metrics { justify-content: space-between; }
  .presence-metric small { font-size: 8px; }
  .presence-metric strong { font-size: 12px; }
  .control-column { display: flex; }
  .voice-panel, .timer-panel, .voyage-panel { padding: 20px 18px; }
  .sea-scene { min-height: 340px; }
  .route-stop span { font-size: 8px; }
  .route-stop small { font-size: 7px; }
  .footer { flex-direction: column; justify-content: center; gap: 8px; padding: 18px 0; text-align: center; }
  .footer a { max-width: 100%; justify-content: center; padding: 9px 12px; font-size: 11px; line-height: 1.5; text-align: center; }
  .history-drawer { padding: 22px 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
