/* Park Radio — Guide Manager */
:root {
	--blue: #2c5fbe;
	--blue-dark: #1f4a97;
	--blue-bg: #e8effb;
	--green: #4e9a2c;
	--green-bg: #e6f4de;
	--dark: #0d1b38;
	--bg: #f2f4f8;
	--card: #fff;
	--ink: #14203a;
	--muted: #5f6b80;
	--line: #dde3ec;
	--amber: #8a5a00;
	--amber-bg: #fff2d6;
	--red: #c62828;
	--red-bg: #fdecea;
	--radius: 16px;
	--shadow: 0 1px 2px rgba(13,27,56,.06), 0 6px 18px rgba(13,27,56,.06);
	--safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
body.no-scroll { overflow: hidden; }
button, input, select, textarea { font: inherit; color: inherit; }
input, select, textarea { font-size: 16px; } /* stops iPhone zooming in */
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.boot { padding: 30vh 16px; text-align: center; color: var(--muted); }
.wrap { max-width: 720px; margin: 0 auto; padding: 0 14px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px; border-radius: 999px; border: 1.5px solid transparent; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:disabled { opacity: .6; cursor: default; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:active { background: var(--blue-dark); }
.btn.ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn.danger { background: var(--card); border-color: #f1c5c5; color: var(--red); }
.btn.block { width: 100%; }
.icon-btn { width: 44px; height: 44px; flex: 0 0 auto; border: 0; border-radius: 50%; background: transparent; cursor: pointer; font-size: 1.3rem; color: inherit; display: inline-flex; align-items: center; justify-content: center; }
.icon-btn:active { background: rgba(0,0,0,.06); }

/* Login */
.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; background: linear-gradient(160deg, var(--blue), var(--dark)); }
.login form { width: 100%; max-width: 380px; background: var(--card); border-radius: 22px; padding: 28px 22px; box-shadow: 0 30px 60px -20px rgba(0,0,0,.45); }
.login .logo { display: block; max-height: 64px; max-width: 70%; margin: 0 auto 10px; }
.login h1 { text-align: center; margin: 0 0 4px; font-size: 1.5rem; }
.login p.sub { text-align: center; margin: 0 0 20px; color: var(--muted); }

/* Top bar */
.top { position: sticky; top: 0; z-index: 20; background: var(--blue); color: #fff; padding-top: env(safe-area-inset-top, 0px); box-shadow: 0 2px 10px rgba(13,27,56,.2); }
.top .wrap { display: flex; align-items: center; gap: 10px; min-height: 60px; }
.top .logo { height: 34px; width: auto; background: #fff; border-radius: 8px; padding: 3px 6px; }
.top h1 { margin: 0; font-size: 1.2rem; flex: 1; }
.menu { position: absolute; right: 12px; top: calc(56px + env(safe-area-inset-top, 0px)); background: var(--card); color: var(--ink); border-radius: 14px; box-shadow: 0 16px 40px rgba(13,27,56,.25); min-width: 230px; overflow: hidden; z-index: 30; }
.menu a, .menu button { display: block; width: 100%; text-align: left; padding: 14px 18px; background: none; border: 0; border-bottom: 1px solid var(--line); text-decoration: none; color: inherit; cursor: pointer; }
.menu :last-child { border-bottom: 0; }
.menu .who { padding: 12px 18px; font-size: .85rem; color: var(--muted); border-bottom: 1px solid var(--line); }

/* Search + filters */
.tools { padding: 14px 0 4px; }
.search { position: relative; }
.search input { width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: 999px; padding: 0 44px 0 44px; background: var(--card); }
.search input:focus { outline: none; border-color: var(--blue); }
.search::before { content: "🔍"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: .95rem; opacity: .6; }
.search .clear { position: absolute; right: 4px; top: 2px; }
.tabs { display: flex; gap: 6px; margin: 12px 0 8px; background: #e3e8f0; padding: 4px; border-radius: 999px; }
.tabs button { flex: 1; min-height: 40px; border: 0; background: transparent; border-radius: 999px; font-weight: 700; font-size: .92rem; color: var(--muted); cursor: pointer; white-space: nowrap; padding: 0 8px; }
.tabs button[aria-selected=true] { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.tabs .n { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber-bg); color: var(--amber); font-size: .78rem; margin-left: 4px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 10px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; min-height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 600; font-size: .9rem; cursor: pointer; white-space: nowrap; }
.chip[aria-pressed=true] { background: var(--dark); border-color: var(--dark); color: #fff; }

/* List */
.sec-h { margin: 18px 4px 8px; font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
main.wrap { overflow-x: clip; }
.card { min-width: 0; display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; }
.card:active { transform: scale(.99); }
.card .badge { flex: 0 0 56px; height: 60px; border-radius: 12px; background: var(--blue); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.05; text-transform: uppercase; font-weight: 700; }
.card .badge .d { font-size: 1.35rem; font-weight: 800; }
.card .badge .s { font-size: .68rem; letter-spacing: .06em; opacity: .9; }
.card .badge.wk { background: var(--green-bg); color: var(--green); }
.card .badge.mo { background: var(--blue-bg); color: var(--blue); }
.card .badge.off { background: #eceff4; color: var(--muted); }
.card .body { flex: 1; min-width: 0; }
.card .t { font-weight: 700; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .m { font-size: .88rem; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .chev { color: #b4bccb; font-size: 1.4rem; }
.flag { display: inline-block; font-size: .72rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; border-radius: 6px; padding: 1px 7px; margin-bottom: 3px; }
.flag.check { background: var(--amber-bg); color: var(--amber); }
.flag.hidden { background: #eceff4; color: var(--muted); }
.flag.today { background: #ffe066; color: #3a2f00; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; }
.pad-b { height: calc(110px + var(--safe-b)); }

.fab { position: fixed; z-index: 15; left: 50%; transform: translateX(-50%); bottom: calc(18px + var(--safe-b)); min-height: 56px; padding: 0 26px; border-radius: 999px; border: 0; background: var(--green); color: #fff; font-weight: 800; font-size: 1.05rem; box-shadow: 0 12px 28px -6px rgba(78,154,44,.6); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.fab span { font-size: 1.5rem; line-height: 1; margin-top: -2px; }

/* Editor sheet */
.sheet { position: fixed; inset: 0; z-index: 40; background: var(--bg); display: flex; flex-direction: column; animation: up .2s ease-out; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } }
.sheet-top { background: var(--card); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.sheet-top .wrap { display: flex; align-items: center; gap: 8px; min-height: 58px; }
.sheet-top h2 { margin: 0; font-size: 1.1rem; flex: 1; }
.sheet-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px 0 30px; }
.sheet-foot { background: var(--card); border-top: 1px solid var(--line); padding: 10px 0 calc(10px + var(--safe-b)); }
.sheet-foot .wrap { display: flex; gap: 10px; }
.sheet-foot .btn.primary { flex: 1; }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.box h3 { margin: 0 0 12px; font-size: .8rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.field { display: block; margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.field > span { display: block; font-weight: 700; font-size: .95rem; margin-bottom: 6px; }
.field > span em { font-style: normal; font-weight: 500; color: var(--muted); }
.field input, .field select, .field textarea { width: 100%; min-height: 48px; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; background: #fff; }
.field textarea { min-height: 150px; resize: vertical; line-height: 1.5; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-bg); }
.hint { font-size: .85rem; color: var(--muted); margin: 6px 0 0; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.quick button { border: 1px solid var(--line); background: var(--bg); border-radius: 999px; padding: 6px 12px; font-size: .88rem; font-weight: 600; cursor: pointer; }

.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #e3e8f0; padding: 4px; border-radius: 14px; margin-bottom: 14px; }
.seg button { min-height: 46px; border: 0; background: transparent; border-radius: 11px; font-weight: 700; font-size: .92rem; color: var(--muted); cursor: pointer; line-height: 1.15; }
.seg button[aria-pressed=true] { background: var(--card); color: var(--blue); box-shadow: var(--shadow); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.days button { min-height: 48px; border: 1.5px solid var(--line); background: #fff; border-radius: 12px; font-weight: 800; font-size: .85rem; cursor: pointer; padding: 0; }
.days button[aria-pressed=true] { background: var(--green); border-color: var(--green); color: #fff; }
.check-row { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; font-weight: 600; }
.check-row input { width: 24px; height: 24px; accent-color: var(--blue); flex: 0 0 auto; }
details.more { margin-top: 6px; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--blue); padding: 8px 0; list-style: none; }
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "+ "; }
details.more[open] summary::before { content: "− "; }
.skips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.skips span { display: inline-flex; align-items: center; gap: 4px; background: var(--red-bg); color: var(--red); border-radius: 999px; padding: 4px 4px 4px 12px; font-size: .88rem; font-weight: 600; }
.skips button { border: 0; background: transparent; color: inherit; width: 26px; height: 26px; border-radius: 50%; cursor: pointer; font-size: 1rem; }
.addskip { display: flex; gap: 8px; }
.addskip input { flex: 1; }

.preview { background: var(--green-bg); color: #24521a; border-radius: 12px; padding: 12px 14px; font-weight: 600; font-size: .95rem; }
.preview.warn { background: var(--amber-bg); color: var(--amber); }
.preview small { display: block; font-weight: 500; margin-top: 3px; opacity: .9; }
.note { background: var(--amber-bg); color: var(--amber); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-size: .92rem; }
.danger-zone { display: flex; gap: 10px; flex-wrap: wrap; }
.danger-zone .btn { flex: 1; min-width: 140px; }

.err { background: var(--red-bg); color: var(--red); border-radius: 12px; padding: 12px 14px; margin-bottom: 14px; font-weight: 600; }

/* Toast */
.toast { position: fixed; z-index: 60; left: 50%; bottom: calc(88px + var(--safe-b)); transform: translateX(-50%); background: var(--dark); color: #fff; border-radius: 14px; padding: 12px 16px; display: flex; gap: 14px; align-items: center; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100% - 28px); width: max-content; animation: up .2s ease-out; }
.toast button { background: transparent; border: 0; color: #9ec3ff; font-weight: 800; cursor: pointer; padding: 4px; }

/* Confirm */
.dim { position: fixed; inset: 0; z-index: 70; background: rgba(13,27,56,.5); display: flex; align-items: flex-end; justify-content: center; padding: 16px 16px calc(16px + var(--safe-b)); }
.dialog { background: var(--card); border-radius: 20px; padding: 22px 18px 16px; width: 100%; max-width: 420px; animation: up .2s ease-out; }
.dialog h3 { margin: 0 0 6px; }
.dialog p { margin: 0 0 16px; color: var(--muted); }
.dialog .btn { width: 100%; margin-top: 8px; }

@media (min-width: 700px) {
	.dim { align-items: center; }
	.sheet { left: 50%; right: auto; width: 640px; transform: translateX(-50%); box-shadow: 0 0 0 100vmax rgba(13,27,56,.45); }
	@keyframes up { from { opacity: 0; } }
}
