:root { --bg:#071015; --panel:#0d1a21; --panel-2:#10232b; --line:#1c353e; --text:#f3f8f9; --muted:#86a1aa; --cyan:#46d7e8; --green:#44e49d; --orange:#ffad55; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
html { background:var(--bg); color-scheme:dark; }
body { margin:0; background:radial-gradient(circle at 75% -10%, #173942 0, transparent 38%), var(--bg); color:var(--text); font-family:Arial, Helvetica, sans-serif; }
button, input { font:inherit; }
button { cursor:pointer; }
.app-shell { width:min(1180px, 100%); margin:auto; padding:32px 28px 18px; min-height:100vh; }
.topbar { display:flex; align-items:center; gap:15px; margin-bottom:28px; }
.brand-mark { width:48px; height:48px; border:1px solid #32717c; background:#0c262e; display:grid; place-items:center; clip-path:polygon(50% 0, 94% 25%, 94% 75%, 50% 100%, 6% 75%, 6% 25%); }
.brand-mark span { font-weight:900; font-size:24px; color:var(--cyan); }
.eyebrow, .metric-label { margin:0 0 5px; color:var(--muted); font-size:11px; font-weight:800; letter-spacing:.16em; }
h1, h2, p { margin-top:0; }
h1 { margin:0; font-size:24px; letter-spacing:.01em; }
h2 { margin:0; font-size:19px; }
.top-actions { margin-left:auto; display:flex; gap:10px; }
.icon-button, .install-button { border:1px solid var(--line); color:#cfe3e7; background:#0d1a21; border-radius:9px; min-height:42px; padding:0 14px; }
.source-button { display:flex; align-items:center; border:1px solid var(--line); color:var(--cyan); background:#0d1a21; border-radius:9px; min-height:42px; padding:0 14px; text-decoration:none; font-size:13px; font-weight:700; }
.icon-button { width:42px; padding:0; font-size:20px; }
.install-button { color:var(--cyan); font-weight:700; }
.status-card { border:1px solid #27634e; background:linear-gradient(145deg, rgba(30,91,70,.48), rgba(10,28,30,.88) 58%); border-radius:16px; padding:24px; box-shadow:0 25px 70px rgba(0,0,0,.25); }
.status-card.is-low { border-color:#734d2e; background:linear-gradient(145deg, rgba(104,57,26,.5), rgba(25,25,24,.9) 58%); }
.status-head { display:flex; align-items:center; gap:10px; }
.status-dot { width:10px; height:10px; border-radius:50%; background:var(--green); box-shadow:0 0 15px var(--green); }
.is-low .status-dot { background:var(--orange); box-shadow:0 0 15px var(--orange); }
.status-title { color:var(--green); font-size:15px; font-weight:900; letter-spacing:.13em; }
.is-low .status-title { color:var(--orange); }
.live-label { margin-left:auto; color:#87ada8; font-size:10px; letter-spacing:.12em; }
.level-row { display:flex; align-items:end; justify-content:space-between; margin:24px 0 18px; }
.big-level { margin:0; font-size:72px; line-height:.9; font-weight:800; letter-spacing:-.06em; }
.big-level small { font-size:24px; color:#adc2c6; margin-left:8px; letter-spacing:0; }
.trend-badge { border:1px solid rgba(89,215,181,.25); background:rgba(33,110,91,.25); color:#7be6c3; font-size:11px; font-weight:800; letter-spacing:.08em; border-radius:999px; padding:9px 12px; }
.limit-panel { display:grid; grid-template-columns:1fr 1fr; border-top:1px solid rgba(134,194,179,.22); padding-top:20px; }
.limit-panel > div + div { border-left:1px solid rgba(134,194,179,.22); padding-left:34px; }
.limit-time { font-size:48px; line-height:1; font-weight:800; margin:4px 0 5px; letter-spacing:-.04em; }
.limit-date, .countdown-note { margin:0; color:#9eb3b7; font-size:13px; }
.official-message { margin:10px 0 7px; font-size:24px; line-height:1.15; font-weight:800; max-width:390px; }
.manual-note { margin:9px 0 0; color:#b8cccf; font-size:15px; line-height:1.55; max-width:420px; }
.countdown { font-family:var(--font-geist-mono), monospace; font-size:37px; font-weight:700; margin:10px 0 6px; letter-spacing:.02em; color:var(--green); }
.is-low .countdown { color:var(--orange); }
.dashboard-grid { display:grid; grid-template-columns:minmax(0, 2fr) minmax(280px, .78fr); gap:18px; margin-top:18px; }
.panel { border:1px solid var(--line); background:linear-gradient(145deg, rgba(16,35,43,.95), rgba(10,22,28,.98)); border-radius:14px; padding:20px; }
.panel-header { display:flex; align-items:center; justify-content:space-between; }
.legend { color:var(--muted); font-size:12px; }
.legend i { display:inline-block; width:18px; height:2px; background:var(--cyan); vertical-align:middle; margin-right:7px; }
.chart-wrap { margin-top:13px; overflow:hidden; }
.chart { display:block; width:100%; height:auto; overflow:visible; }
.grid-line { stroke:#24404a; stroke-width:1; stroke-dasharray:3 7; }
.tide-line { stroke:var(--cyan); fill:none; stroke-width:3; filter:drop-shadow(0 0 5px rgba(70,215,232,.4)); }
.threshold-line { stroke:#ffb45e; stroke-width:1.5; stroke-dasharray:6 6; }
.threshold-label { fill:#ffc17b; font-size:9px; font-weight:800; letter-spacing:.1em; }
.axis-label { fill:#78949d; font-size:10px; }
.data-note { margin:5px 0 0; color:#66818a; font-size:11px; }
.shom-widget { margin-top:16px; min-height:480px; overflow:auto; border-radius:10px; background:#fff; color:#111; padding:8px; }
.shom-widget iframe { display:block; width:100% !important; max-width:100%; border:0; margin:auto; }
.side-stack { display:grid; gap:18px; }
.window-panel { display:flex; flex-direction:column; justify-content:center; }
.window-panel h2 { text-transform:capitalize; font-size:17px; }
.window-times { display:flex; align-items:center; gap:12px; margin:22px 0 10px; }
.window-times strong { font-size:27px; }
.window-times span { color:var(--cyan); }
.window-panel > p:last-child { color:var(--muted); font-size:12px; margin:0; }
.instructions { margin:20px 0; padding-left:22px; color:#b8cccf; font-size:14px; line-height:1.8; }
.threshold-panel { display:grid; grid-template-columns:auto 1fr; gap:13px; align-items:center; }
.threshold-icon { width:42px; height:42px; display:grid; place-items:center; color:var(--cyan); background:#0f313a; border-radius:50%; font-size:25px; }
.threshold-value { margin:0; font-size:23px; font-weight:800; }
.threshold-panel button { grid-column:1 / -1; border:1px solid #2d5963; background:#102932; color:#95deea; border-radius:8px; padding:10px; font-weight:700; }
.threshold-panel > a { grid-column:1 / -1; border:1px solid #2d5963; background:#102932; color:#95deea; border-radius:8px; padding:10px; font-weight:700; text-align:center; text-decoration:none; }
footer { display:flex; justify-content:space-between; color:#506970; font-size:10px; letter-spacing:.04em; padding:18px 4px 0; }
.modal-backdrop { position:fixed; inset:0; z-index:10; padding:20px; background:rgba(1,6,8,.8); backdrop-filter:blur(8px); display:grid; place-items:center; }
.settings-modal { width:min(560px, 100%); background:#0d1b22; border:1px solid #2a4650; border-radius:16px; padding:24px; box-shadow:0 30px 90px #000; }
.modal-head { display:flex; justify-content:space-between; align-items:start; margin-bottom:24px; }
.settings-modal label { display:grid; gap:8px; color:#bcd0d4; font-size:12px; font-weight:700; margin-bottom:16px; }
.settings-modal input { width:100%; background:#071216; color:white; border:1px solid #29434c; border-radius:8px; padding:12px; outline:none; }
.settings-modal input:focus { border-color:var(--cyan); box-shadow:0 0 0 3px rgba(70,215,232,.1); }
.form-row { display:grid; grid-template-columns:1fr 1fr; gap:14px; }
.form-help { color:#728d95; font-size:12px; line-height:1.5; }
.form-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }
.form-actions button { padding:11px 16px; border-radius:8px; font-weight:800; }
.secondary { color:#a9bec3; background:transparent; border:1px solid #29434c; }
.primary { color:#041114; background:var(--cyan); border:1px solid var(--cyan); }
@media (max-width:760px) {
  .app-shell { padding:20px 14px 14px; }
  .topbar { margin-bottom:18px; }
  .dashboard-grid { grid-template-columns:1fr; }
  .limit-panel { grid-template-columns:1fr; gap:18px; }
  .limit-panel > div + div { border-left:0; border-top:1px solid rgba(134,194,179,.22); padding:18px 0 0; }
  .big-level { font-size:61px; }
  .trend-badge { align-self:center; max-width:145px; text-align:center; line-height:1.4; }
  .limit-time { font-size:42px; }
  .countdown { font-size:31px; }
  footer { flex-direction:column; gap:7px; }
}
@media (max-width:430px) {
  h1 { font-size:20px; }
  .brand-mark { width:42px; height:42px; }
  .install-button { display:none; }
  .status-card { padding:19px; }
  .live-label { display:none; }
  .level-row { align-items:center; }
  .big-level { font-size:54px; }
  .big-level small { font-size:19px; }
  .form-row { grid-template-columns:1fr; gap:0; }
  .panel-header { align-items:start; }
  .legend { display:none; }
}
