[hidden] { display: none !important; }
:root {
  --ink: #0A2536; --ink-2: #33566C; --muted: #5d7584; --bg: #F3FAFF; --card: #fff;
  --line: rgba(10, 37, 54, 0.12); --teal: #5EA8A8; --teal-deep: #4F9595; --mint: #DAF6EF;
  --hot: #b4541a; --hot-bg: #fdeee2; --err: #9b2c2c;
  --font: 'Giga Sans', 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
}
* { box-sizing: border-box; }
body.admin { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--teal-deep); }
h1 { margin: 0; font-size: 30px; letter-spacing: -0.02em; font-weight: 600; }
h2 { font-size: 18px; margin: 36px 0 12px; }
.page { max-width: 1440px; margin: 0 auto; padding: 28px var(--gutter) 80px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.strong { font-weight: 600; }
.center { text-align: center; }
.warn { color: var(--hot); }
.who { font-size: 13px; color: var(--muted); }
.who-out { font-size: 13px; }
@media (max-width: 1279px) { .who, .who-out { display: none; } }
@media (min-width: 1280px) { .ac-nav__ext { display: none; } }

.bar { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.bar p { margin: 4px 0 0; }
.bar__actions { display: flex; gap: 10px; align-items: center; }
.bar__actions form { display: flex; align-items: center; gap: 8px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 0 18px; border-radius: 999px; font: 600 14px var(--font); text-decoration: none; cursor: pointer; border: 1px solid transparent; white-space: nowrap; }
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-deep); }
.btn--primary:disabled { background: #a9c9c9; cursor: not-allowed; }
.btn--ghost { background: var(--card); border-color: var(--line); color: var(--ink); }
.btn--ghost:hover { border-color: var(--teal); }
.btn--ghost:disabled { opacity: .5; cursor: not-allowed; }
.btn--danger { color: var(--err); }
.btn--block { width: 100%; margin-top: 8px; min-height: 46px; }
.link { border: 0; background: none; color: var(--teal-deep); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }
.inline { display: inline-flex; gap: 8px; flex-wrap: wrap; }

.spin { width: 18px; height: 18px; border: 2px solid var(--line); border-top-color: var(--teal); border-radius: 50%; animation: spin .8s linear infinite; display: none; }
.htmx-request .spin, .spin.htmx-request { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.notice { padding: 12px 16px; border-radius: 10px; margin: 0 0 18px; }
.notice--ok { background: var(--mint); }
.notice--err { background: #fbe4e4; color: var(--err); }
.notice pre { white-space: pre-wrap; font-size: 12px; max-height: 240px; overflow: auto; }

.tabs { display: flex; gap: 4px; margin: 8px 0 14px; border-bottom: 1px solid var(--line); }
.tabs a { padding: 8px 14px; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current] { color: var(--ink); border-color: var(--teal); font-weight: 600; }

.table-wrap { overflow-x: auto; }
table.rooms { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }
.rooms th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 10px 14px; background: #f8fbfd; }
.rooms td { padding: 12px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.rooms a.strong { color: var(--ink); text-decoration: none; }
.rooms a.strong:hover { color: var(--teal-deep); }
.row-actions { white-space: nowrap; text-align: right; }
.row-actions > * { margin-left: 12px; font-size: 14px; }
.pill { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eef2f5; font-size: 12px; font-weight: 600; }
.pill--live { background: var(--mint); color: #1e5b4f; }
.pill--hot { background: var(--hot-bg); color: var(--hot); }
.empty { padding: 60px 20px; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: 12px; }

/* builder */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; }
.filters input[type=search] { flex: 1 1 240px; }
input, select, textarea { font: 15px var(--font); color: var(--ink); padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); max-width: 100%; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 0; border-color: transparent; }
.filters select { max-width: 190px; }
.check { display: inline-flex; gap: 6px; align-items: center; font-size: 14px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.card { display: flex; flex-direction: column; text-align: left; padding: 0; border: 2px solid transparent; border-radius: 12px; background: var(--card); box-shadow: 0 1px 2px rgba(10,37,54,.06); cursor: pointer; overflow: hidden; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.card:hover { box-shadow: 0 4px 14px rgba(10,37,54,.12); }
.card--on { border-color: var(--teal); }
.card__img { position: relative; display: block; aspect-ratio: 16 / 10; background: #e6eef3; }
.card__img img { width: 100%; height: 100%; object-fit: cover; }
.card__noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: 13px; }
.card__tick { position: absolute; top: 8px; right: 8px; width: 28px; height: 28px; border-radius: 50%; background: var(--teal); color: #fff; display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.card__body { display: grid; gap: 4px; padding: 10px 12px 12px; }
.card__name { font-weight: 600; font-size: 16px; }
.card__meta { color: var(--muted); font-size: 13px; }
.card__tags { display: flex; flex-wrap: wrap; gap: 4px; }
.card__tags span { font-size: 11.5px; padding: 1px 8px; border-radius: 999px; background: #eef2f5; }
.card__tags .tag--status { background: var(--hot-bg); color: var(--hot); }
.card__tags .tag--lang { background: var(--mint); }
.card__warn { font-size: 12px; color: var(--hot); }

.panel { position: sticky; top: 104px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 20px; max-height: calc(100vh - 120px); overflow-y: auto; }
.panel h2 { margin: 0 0 10px; }
.panel label { display: block; margin-top: 12px; font-size: 14px; font-weight: 500; }
.panel label > input, .panel label > select, .panel label > textarea, .narrow label > input { display: block; margin-top: 4px; }
.panel input, .panel select, .panel textarea { width: 100%; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { border: 0; padding: 0; margin: 12px 0 0; }
.seg legend { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.seg label { display: flex; gap: 8px; align-items: center; margin-top: 4px; font-weight: 400; }
.seg input { width: auto; }
.req { color: var(--hot); }
.selected { margin: 0; padding: 0; list-style: none; counter-reset: s; }
.selected li { counter-increment: s; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.selected li::before { content: counter(s); flex: 0 0 22px; height: 22px; border-radius: 50%; background: var(--mint); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.sel__name { flex: 1; font-weight: 500; }
.sel__warn { display: block; font-size: 12px; color: var(--hot); font-weight: 400; }
.sel__btns { display: flex; gap: 2px; }
.sel__btns button { width: 28px; height: 28px; border: 1px solid var(--line); background: var(--card); border-radius: 6px; cursor: pointer; }
.sel__btns button:disabled { opacity: .35; cursor: default; }

/* room detail */
.linkbox { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.linkbox input { flex: 1 1 320px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 14px; }
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.kpis div { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; color: var(--muted); font-size: 13px; }
.kpis span { display: block; color: var(--ink); font-size: 22px; font-weight: 600; }
.feed { list-style: none; margin: 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.feed li { padding: 10px 16px; border-top: 1px solid var(--line); }
.feed li:first-child { border-top: 0; }
.feed li .muted { display: inline-block; min-width: 150px; }
.feed--hot { background: var(--hot-bg); border-color: #f2d3bb; }
.feed blockquote { margin: 6px 0 0; padding-left: 10px; border-left: 3px solid var(--hot); }
.narrow { max-width: 480px; display: grid; gap: 12px; }
.narrow label { display: block; font-weight: 500; }

@media (max-width: 1080px) {
  .builder { grid-template-columns: 1fr; }
  .panel { position: static; max-height: none; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}

/* link form */
.narrow { max-width: 560px; }
.narrow label > input, .narrow label > select, .narrow label > textarea { display: block; width: 100%; margin-top: 4px; }
.narrow .seg label { display: flex; align-items: center; gap: 8px; font-weight: 400; margin-top: 6px; }
.narrow .seg input[type=radio] { width: auto; margin: 0; }
.narrow .seg input[type=date] { width: auto; display: inline-block; margin: 0 0 0 4px; }
.narrow .seg input[type=date]:disabled { opacity: .45; }
.narrow > .btn { justify-self: start; }
.req { color: var(--hot); }
code { font-size: 13px; background: #eef2f5; padding: 1px 6px; border-radius: 6px; }

/* ---- Allora Maps ---- */
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 13px; }
.empty { background: var(--card); border: 1px dashed var(--line); border-radius: 14px; padding: 28px; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.pill { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: #e9eef1; color: var(--ink-2); letter-spacing: .02em; }
.pill--published { background: var(--mint); color: #12614f; }
.pill--internal { background: var(--hot-bg); color: var(--hot); }
.pill--archived { background: #eee; color: #777; }
.mapgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.mapcard { background: var(--card); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.mapcard__img { display: block; aspect-ratio: 1200 / 630; background: #e7ecef; }
.mapcard__img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mapcard__img span { display: flex; height: 100%; align-items: center; justify-content: center; color: var(--muted); font-size: 13px; }
.mapcard__body { padding: 14px 16px 16px; }
.mapcard h3 { margin: 2px 0 6px; font-size: 17px; line-height: 1.3; }
.mapcard h3 a { color: var(--ink); text-decoration: none; }
.mapcard p { margin: 2px 0; }
.mapcard__actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.sharebox { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.sharebox__img img { width: 100%; border-radius: 10px; display: block; border: 1px solid var(--line); }
.noimg { aspect-ratio: 1200/630; background: #eef2f4; border-radius: 10px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; color: var(--muted); font-size: 13px; }
@media (max-width: 860px) { .sharebox { grid-template-columns: 1fr; } }
.copyrow { display: flex; gap: 8px; }
.copyrow input { flex: 1; min-width: 0; font: 13px ui-monospace, SFMono-Regular, Menlo, monospace; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #f8fbfd; color: var(--ink); }
code { font: 12.5px ui-monospace, SFMono-Regular, Menlo, monospace; background: #eef3f6; padding: 1px 5px; border-radius: 4px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.kpi { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; display: flex; flex-direction: column; }
.kpi__v { font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.kpi__l { font-size: 12.5px; color: var(--muted); }
.daily { display: flex; align-items: flex-end; gap: 3px; height: 140px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 14px 26px; margin-top: 14px; }
.daily__col { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; position: relative; }
.daily__bar { display: block; background: var(--teal); border-radius: 3px 3px 0 0; min-height: 1px; }
.daily__lbl { position: absolute; bottom: -20px; left: 50%; transform: translateX(-50%); font-size: 11px; color: var(--muted); white-space: nowrap; }
.cols3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.cols3 h3 { font-size: 14px; margin: 0 0 6px; }
@media (max-width: 760px) { .cols3 { grid-template-columns: 1fr; } }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; }
.linkform { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0 14px; }
.linkform input, .linkform select { min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; font: 14px var(--font); background: #fff; color: var(--ink); }
.linkform input[name=recipient] { flex: 1 1 260px; }
.linkform input[name=note] { flex: 1 1 200px; }
table.small td { font-size: 13px; }
tr.muted td { color: var(--muted); }
.login { display: grid; gap: 14px; max-width: 320px; margin: 24px auto 0; text-align: left; }
.login input { width: 100%; margin-top: 4px; }
.login__error { color: #B3261E; margin: 0; font-size: 14px; }
