/* Cyber News v1 stylesheet */

@font-face { font-family: "Archivo"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/archivo-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/archivo-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/archivo-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); }

:root {
  --font-head: "Archivo", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --accent: #f28c28;
  --accent-soft: rgba(242, 140, 40, 0.16);
  --danger: #e5484d;
  --ok: #3ccf8e;
  --side-w: 300px;
  --gap: 18px;
  --radius: 8px;
  --topbar-h: 150px;
}

.theme-dark {
  --bg: #1c1f24;
  --bg-2: #22262c;
  --surface: #292e36;
  --surface-hover: #323944;
  --line: #343a44;
  --text: #e9ebef;
  --text-2: #aeb5bf;
  --text-3: #7c8591;
  --input-bg: #33393f;
  --shadow: 0 1px 0 rgba(0,0,0,0.35);
  color-scheme: dark;
}
.theme-light {
  --bg: #eef0f3;
  --bg-2: #e6e8ec;
  --surface: #ffffff;
  --surface-hover: #f5f0e8;
  --line: #d8dbe0;
  --text: #1b1e23;
  --text-2: #4d5560;
  --text-3: #7a828d;
  --input-bg: #ffffff;
  --shadow: 0 1px 2px rgba(20,24,30,0.08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
body.page-admin, body.page-install { overflow: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-head); margin: 0; }
.muted { color: var(--text-2); }
.mono { font-family: var(--font-mono); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Layout ---------- */

.app {
  height: 100vh;
  height: 100dvh;
  display: grid;
  grid-template-rows: var(--topbar-h) 1fr;
}

.topbar {
  display: grid;
  grid-template-columns: var(--side-w) 1fr var(--side-w);
  gap: var(--gap);
  padding: 22px 24px 0;
  align-items: start;
}
.clock { padding-top: 6px; }
.clock .time {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.clock .time .ampm { font-size: 20px; vertical-align: top; margin-left: 4px; font-weight: 600; }
.clock .date { font-family: var(--font-mono); font-size: 16px; color: var(--text-2); margin-top: 8px; }

.top-center { padding-top: 14px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.search {
  width: min(720px, 100%);
  display: flex;
  align-items: center;
  background: var(--input-bg);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 10px 0 12px;
  height: 42px;
}
.search svg { width: 18px; height: 18px; flex: 0 0 auto; color: var(--text-3); }
.search input {
  flex: 1; border: 0; background: transparent; color: var(--text); font: inherit; font-size: 15px; padding: 0 10px; height: 100%;
}
.search input::placeholder { color: var(--text-3); }
.search input:focus { outline: none; }
.quick-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; min-height: 22px; }
.quick-links a { color: var(--text-2); font-size: 13px; padding: 2px 6px; border-radius: 4px; display: inline-flex; align-items: center; gap: 6px; }
.quick-links a img { width: 16px; height: 16px; border-radius: 3px; flex: 0 0 auto; }
.quick-links a:hover { color: var(--accent); background: var(--accent-soft); }

.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; padding-top: 6px; }
.icon-row { display: flex; gap: 6px; }
.icon-btn {
  width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer; color: var(--text-2);
}
.icon-btn:hover { color: var(--accent); border-color: var(--line); background: var(--accent-soft); }
.icon-btn svg { width: 18px; height: 18px; }
.weather { display: flex; align-items: center; gap: 10px; color: var(--text-2); font-size: 13px; min-height: 48px; }
.weather .wx-icon { width: 46px; height: 46px; color: var(--text-2); flex: 0 0 auto; }
.weather .wx-icon svg { width: 100%; height: 100%; }
.weather .wx-text { display: flex; flex-direction: column; line-height: 1.25; }
.weather .temp { font-family: var(--font-head); font-weight: 700; font-size: 22px; color: var(--text); }
.weather .desc { font-size: 12.5px; }
.weather .city { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-top: 2px; }

.menu-btn { display: none; width: 34px; height: 34px; flex: 0 0 auto; }
.mobile-menu {
  display: none; width: min(720px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px; box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  flex-wrap: wrap; gap: 4px;
}
.mobile-menu[hidden] { display: none !important; }
.mm-item {
  flex: 1 1 auto; text-align: center; padding: 9px 12px; border-radius: 6px; border: 0; background: transparent; color: var(--text-2); font-size: 14px; cursor: pointer;
}
.mm-item:hover { background: var(--surface-hover); color: var(--text); }
.mm-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

.app-scroll { height: auto; min-height: 100vh; display: block; }
.app-scroll .topbar { margin-bottom: 4px; }
body.page-calendar { overflow: auto; }
.page-calendar .cal-page { padding-top: 10px; }

.grid {
  display: grid;
  grid-template-columns: var(--side-w) 1fr var(--side-w);
  gap: var(--gap);
  padding: 0 24px 0;
  min-height: 0;
}
.col { min-height: 0; display: flex; flex-direction: column; }
.col-side { overflow: hidden; }
.col-side .col-body { flex: 1; min-height: 0; overflow: hidden; }
.col-side .col-foot { flex: 0 0 auto; padding: 10px 0 14px; text-align: center; font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }

.col-head { display: flex; align-items: baseline; gap: 14px; flex: 0 0 auto; margin-bottom: 14px; }
.col-head h2 {
  font-size: 26px; font-weight: 700; letter-spacing: -0.01em;
  padding-bottom: 6px; border-bottom: 3px solid var(--accent); display: inline-block;
}
.col-head .sub { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.col-head .spacer { flex: 1; }
.col-head .link { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.col-head .link:hover { color: var(--accent); }

/* side column stubs (Phase 2 fills these) */
.new-row { display: flex; gap: 8px; margin-bottom: 14px; }
.new-row input {
  flex: 1; height: 40px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 0 12px; font: inherit;
}
.new-row .icon-btn { width: 40px; height: 40px; border-color: var(--line); background: var(--input-bg); }
.side-list { display: flex; flex-direction: column; gap: 10px; }
.side-card {
  background: var(--surface); border: 1px solid var(--line); border-left-width: 3px; border-radius: var(--radius);
  padding: 10px 12px; box-shadow: var(--shadow); cursor: pointer;
}
.side-card:hover { background: var(--surface-hover); border-color: var(--accent); }
.side-card .t { font-family: var(--font-head); font-weight: 600; font-size: 14px; }
.side-card .d { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); margin-top: 4px; }
.empty {
  color: var(--text-3); font-size: 13px; padding: 14px 4px; line-height: 1.5;
}

/* ---------- Headlines ---------- */

.cats { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; flex: 0 0 auto; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; height: 28px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-size: 12.5px; cursor: pointer; font-family: var(--font-body);
}
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--dot, var(--text-3)); }
.chip:hover { border-color: var(--accent); color: var(--text); background: var(--surface-hover); }
.chip.active { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.chip.active .dot { box-shadow: 0 0 0 2px var(--accent-soft); }

.news-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: none; -ms-overflow-style: none;
  padding-top: 8px; padding-bottom: 40px;
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 28px), transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 22px, #000 calc(100% - 28px), transparent 100%);
}
.news-scroll::-webkit-scrollbar { display: none; }
.masonry { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: var(--gap); align-items: start; }
.mcol { display: flex; flex-direction: column; gap: var(--gap); min-width: 0; }

.card {
  display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow); color: var(--text);
}
.card:hover, .card:focus-visible { background: var(--surface-hover); border-color: var(--accent); }
.card:hover .card-title { color: var(--accent); }
.card img { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--bg-2); }
.card-body { padding: 12px 14px 12px; }
.card-title { font-family: var(--font-head); font-weight: 700; font-size: 16.5px; line-height: 1.25; letter-spacing: -0.005em; }
.card-summary { font-family: var(--font-body); font-weight: 400; font-size: 13px; line-height: 1.45; color: var(--text-2); margin-top: 8px; }
.card-meta { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); margin-top: 10px; display: flex; flex-direction: column; gap: 2px; }
.card-meta .feed { display: inline-flex; align-items: center; gap: 6px; }
.card-meta .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--dot, var(--text-3)); flex: 0 0 auto; }
.card.no-image .card-title { font-size: 17px; }

.news-status { text-align: center; color: var(--text-3); font-family: var(--font-mono); font-size: 12px; padding: 16px 0 30px; }
.sentinel { height: 1px; }

/* ---------- Buttons, forms ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 6px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; font-size: 13.5px;
}
.btn:hover { background: var(--surface-hover); border-color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #1b1408; font-weight: 500; }
.btn-primary:hover { background: #ff9d3f; border-color: #ff9d3f; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn[disabled] { opacity: 0.55; cursor: default; }

input[type="text"], input[type="password"], input[type="number"], input[type="url"], input[type="date"], select, textarea {
  width: 100%; height: 38px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 6px;
  color: var(--text); padding: 0 10px; font: inherit; font-size: 13.5px;
}
textarea { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; }
input[type="color"] { width: 44px; height: 38px; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--input-bg); }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--text-2); }
label.inline { flex-direction: row; align-items: center; gap: 8px; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.row > * { flex: 1 1 160px; }
.row > .fit { flex: 0 0 auto; }
.hint { font-size: 12px; color: var(--text-3); }
code { font-family: var(--font-mono); font-size: 12.5px; background: var(--bg-2); padding: 1px 5px; border-radius: 4px; }

.alert { padding: 10px 12px; border-radius: 6px; border: 1px solid var(--line); background: var(--surface); font-size: 13.5px; }
.alert-error { border-color: var(--danger); color: var(--danger); }
.alert-ok { border-color: var(--ok); }

/* ---------- Login ---------- */

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-box, .install-box {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px 28px 24px; box-shadow: var(--shadow);
}
.install-box { width: min(520px, 100%); margin: 40px auto; }
.login-box h1, .install-box h1 { font-size: 22px; margin-bottom: 4px; }
.login-box .brand { font-family: var(--font-mono); font-size: 12px; color: var(--accent); margin-bottom: 18px; }
.login-box form { margin-top: 18px; }
.install-notes { padding-left: 18px; color: var(--text-2); }

/* ---------- Admin ---------- */

.admin { max-width: 1180px; margin: 0 auto; padding: 24px 24px 60px; }
.admin-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.admin-head h1 { font-size: 26px; }
.admin-head .ver { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); }
.admin-head .spacer { flex: 1; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tab { padding: 10px 14px; border: 0; background: transparent; color: var(--text-2); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; font-size: 14px; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); font-weight: 500; }
.panel { display: none; }
.panel.active { display: block; }
.panel h2 { font-size: 18px; margin-bottom: 12px; }
.box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 18px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th, .table td { text-align: left; padding: 9px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table th { font-family: var(--font-mono); font-weight: 500; font-size: 11.5px; color: var(--text-3); }
.table tr:hover td { background: var(--surface-hover); }
.table td.actions { white-space: nowrap; text-align: right; }
.table td input, .table td select { height: 32px; font-size: 13px; }
.table .status-ok { color: var(--ok); }
.table .status-error { color: var(--danger); }
.table .status-never { color: var(--text-3); }
.pill { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-family: var(--font-mono); border: 1px solid var(--line); }
.swatch { display: inline-block; width: 12px; height: 12px; border-radius: 50%; vertical-align: middle; margin-right: 6px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.stat { background: var(--bg-2); border-radius: 6px; padding: 12px; }
.stat .n { font-family: var(--font-head); font-weight: 700; font-size: 24px; }
.stat .l { font-size: 12px; color: var(--text-3); }
.log { font-family: var(--font-mono); font-size: 12px; white-space: pre-wrap; background: var(--bg-2); padding: 12px; border-radius: 6px; color: var(--text-2); max-height: 260px; overflow: auto; }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px 20px; }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--accent);
  color: var(--text); padding: 10px 16px; border-radius: 8px; font-size: 13.5px; box-shadow: 0 6px 24px rgba(0,0,0,0.3); z-index: 50; opacity: 0; pointer-events: none;
  transition: opacity 0.2s;
}
.toast.show { opacity: 1; }
.toast.err { border-color: var(--danger); }
.drag-handle { cursor: grab; color: var(--text-3); user-select: none; }
.link-icon { display: inline-block; width: 24px; height: 24px; border-radius: 5px; vertical-align: middle; }
.link-icon-none { border: 1px dashed var(--line); }

.w2 { flex: 2 1 300px; }
.btn-group { display: flex; gap: 8px; }
.m0 { margin: 0; }
.mt10 { margin-top: 10px; margin-bottom: 0; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.row-center { align-items: center; margin-bottom: 10px; }
.h-log { margin: 16px 0 8px; font-size: 14px; }
.box-narrow { max-width: 460px; }
.dim { opacity: 0.5; }
.w70 { width: 70px; }


/* ---------- Events and tasks (side columns) ---------- */

.new-row .date-mini { flex: 0 0 132px; height: 40px; font-family: var(--font-mono); font-size: 12.5px; padding: 0 8px; }
.link-btn { background: transparent; border: 0; cursor: pointer; padding: 0; }
.link-btn.active { color: var(--accent); }
.col-side .col-body {
  -webkit-mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 36px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0, #000 calc(100% - 36px), transparent 100%);
  padding-bottom: 36px;
}
.side-card { position: relative; border-left-color: var(--ev, var(--accent)); }
.side-card .t { color: var(--ev, var(--text)); padding-right: 24px; }
.side-card .when { font-family: var(--font-body); font-style: italic; font-size: 12px; color: var(--text-2); margin-top: 1px; }
.side-card .when.today { color: var(--accent); font-style: normal; font-weight: 500; }
.side-card .d { color: var(--text-2); }
.side-card .del {
  position: absolute; top: 8px; right: 8px; width: 22px; height: 22px; border: 0; background: transparent; color: var(--text-3);
  border-radius: 4px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; opacity: 0;
}
.side-card:hover .del, .side-card:focus-within .del { opacity: 1; }
.side-card .del:hover { color: var(--danger); background: var(--bg-2); }
.side-card .del svg { width: 14px; height: 14px; }

.task-card { display: flex; align-items: flex-start; gap: 10px; border-left-color: var(--line); cursor: default; }
.task-card.dragging { opacity: 0.4; }
.task-card .chk {
  flex: 0 0 auto; width: 18px; height: 18px; margin-top: 2px; border-radius: 50%; border: 2px solid var(--text-3); background: transparent; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center; color: transparent;
}
.task-card .chk:hover { border-color: var(--accent); color: var(--accent); }
.task-card .chk svg { width: 10px; height: 10px; }
.task-card.done .chk { background: var(--ok); border-color: var(--ok); color: #0c2a1c; }
.task-card .body { flex: 1; min-width: 0; cursor: pointer; }
.task-card .t { color: var(--text); font-weight: 500; font-family: var(--font-body); font-size: 14px; }
.task-card.done .t { text-decoration: line-through; color: var(--text-3); }
.task-card .due { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.task-card .due.overdue { color: var(--danger); }
.task-card .due.soon { color: var(--accent); }
.task-card .grip { flex: 0 0 auto; color: var(--text-3); cursor: grab; opacity: 0; padding-top: 2px; font-size: 14px; user-select: none; }
.task-card:hover .grip { opacity: 1; }
.task-card .del { position: static; opacity: 0; }
.task-card:hover .del { opacity: 1; }

/* unified quick-add box (single bordered field with icon buttons inside) */
.quick-box {
  display: flex; align-items: center; height: 42px; margin-bottom: 14px; position: relative;
  background: var(--input-bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden;
}
.quick-box:focus-within { border-color: var(--accent); }
.quick-box input[type="text"] { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; color: var(--text); padding: 0 12px; font: inherit; font-size: 14px; }
.quick-box input[type="text"]:focus { outline: none; }
.quick-box input[type="text"]::placeholder { color: var(--text-3); }
.quick-sep { width: 1px; align-self: stretch; margin: 8px 0; background: var(--line); flex: 0 0 auto; }
.quick-btn {
  flex: 0 0 44px; height: 100%; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; border: 0; color: var(--text-2); cursor: pointer;
}
.quick-btn:hover { color: var(--accent); background: var(--accent-soft); }
.quick-btn svg { width: 20px; height: 20px; }
.quick-date { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); padding: 0 8px; white-space: nowrap; flex: 0 0 auto; }
.quick-date-input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; left: 0; bottom: 0; border: 0; padding: 0; }

/* ---------- Modal ---------- */

.modal-back {
  position: fixed; inset: 0; background: rgba(8, 10, 14, 0.55); display: none; align-items: center; justify-content: center; z-index: 40; padding: 20px;
}
.modal-back.open { display: flex; }
.modal {
  width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; padding: 20px 22px 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.45);
}
.modal h3 { font-size: 18px; margin-bottom: 14px; }
.modal .row { align-items: end; }
.modal .foot { display: flex; gap: 8px; margin-top: 16px; }
.modal .foot .spacer { flex: 1; }
.modal .swatches { display: flex; gap: 6px; flex-wrap: wrap; }
.modal .swatch-btn { width: 24px; height: 24px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; background: var(--sw); }
.modal .swatch-btn.active { border-color: var(--text); }
.modal .meta { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); margin-top: 8px; }

/* ---------- Calendar page ---------- */

.cal-page { max-width: 1400px; margin: 0 auto; padding: 20px 24px 40px; }
.cal-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h1 { font-size: 26px; min-width: 240px; }
.cal-head .nav { display: flex; gap: 4px; }
.cal-head .spacer { flex: 1; }
.cal-legend { display: flex; gap: 14px; font-size: 12.5px; color: var(--text-2); align-items: center; flex-wrap: wrap; }
.cal-legend .sw { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.cal-legend .sw-ev { background: var(--accent); }
.cal-legend .tk { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--text-3); margin-right: 5px; vertical-align: middle; box-sizing: border-box; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); padding: 4px 6px; }
.cal-day {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); min-height: 118px; padding: 6px 6px 8px;
  display: flex; flex-direction: column; gap: 3px;
}
.cal-day.other { opacity: 0.45; }
.cal-day.today { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.cal-day .num { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.cal-day .num button {
  font-family: var(--font-mono); font-size: 12.5px; color: var(--text-2); background: transparent; border: 0; padding: 2px 5px; border-radius: 4px; cursor: pointer;
}
.cal-day .num button:hover { background: var(--accent-soft); color: var(--accent); }
.cal-day.today .num button { color: var(--accent); font-weight: 500; }
.cal-chip {
  display: flex; align-items: center; gap: 5px; font-size: 12px; line-height: 1.25; padding: 3px 6px; border-radius: 4px; cursor: pointer; text-align: left;
  border: 1px solid transparent; background: transparent; color: var(--text); width: 100%; font-family: var(--font-body);
}
.cal-chip:hover { border-color: var(--accent); background: var(--accent-soft); }
.cal-chip .bar { flex: 0 0 4px; width: 4px; align-self: stretch; border-radius: 2px; background: var(--ev, var(--accent)); min-height: 12px; }
.cal-chip .lbl { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-chip.ev { background: color-mix(in srgb, var(--ev, var(--accent)) 14%, transparent); }
.cal-chip.ev .lbl { color: var(--text); }
.cal-chip.tk .dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; border: 2px solid var(--text-3); box-sizing: border-box; }
.cal-chip.tk.done .dot { background: var(--ok); border-color: var(--ok); }
.cal-chip.tk.done .lbl { text-decoration: line-through; color: var(--text-3); }
.cal-chip.tk.overdue .dot { border-color: var(--danger); }
.cal-chip .time { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-3); flex: 0 0 auto; }
.cal-more { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); padding: 2px 6px; }
@media (max-width: 900px) {
  .cal-grid { gap: 4px; }
  .cal-day { min-height: 80px; padding: 4px; }
  .cal-chip .time { display: none; }
}

/* ---------- Responsive ---------- */

@media (max-width: 1500px) { :root { --side-w: 270px; } }
@media (max-width: 1200px) {
  :root { --topbar-h: auto; }
  .app { grid-template-rows: auto 1fr; }
  .topbar, .grid { grid-template-columns: 1fr; }
  .topbar { padding: 14px 16px 10px; }
  .grid { padding: 0 16px; }
  .clock, .top-right, .quick-links { display: none; }
  .menu-btn { display: inline-flex; }
  .mobile-menu { display: flex; }
  .col-side { display: none; }
  .col-news { display: flex; }
  body.view-events .col-news, body.view-tasks .col-news { display: none; }
  body.view-events #colEvents, body.view-tasks #colTasks { display: flex; }
  .col-side .col-body { overflow-y: auto; -webkit-mask-image: none; mask-image: none; padding-bottom: 20px; }
  .side-card .del, .task-card .grip, .task-card .del { opacity: 1; }
  .news-scroll { padding-bottom: 20px; }
  .cal-page { padding: 10px 12px 30px; }
  .cal-head h1 { min-width: 0; font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
