/* AutoBlog — dark navy sidebar, soft aurora background, glassy white cards.
   Accent gradient teal -> indigo; each site gets its own hue for avatars. */
:root {
  --bg: #f3f5fb;
  --panel: rgba(255, 255, 255, 0.86);
  --panel-solid: #ffffff;
  --ink: #141a33;
  --ink-2: #3b4361;
  --muted: #6d7491;
  --line: #e4e7f2;
  --line-2: #d6dbeb;

  --side: #0d1328;
  --side-2: #161e3d;
  --side-ink: #c4cae3;
  --side-muted: #7880a3;

  --teal: #12b5a6;
  --indigo: #5b5bf0;
  --violet: #8b5cf6;
  --coral: #ff7a59;
  --amber: #f5a524;
  --sky: #2f9bff;
  --grad: linear-gradient(135deg, var(--teal) 0%, var(--indigo) 100%);
  --accent: #4f55e8;
  --accent-soft: #eceefe;
  --accent-ink: #ffffff;

  --ok: #0f9d74; --ok-soft: #e2f7ef;
  --err: #e0445a; --err-soft: #fde8eb;
  --warn: #c27c06; --warn-soft: #fff3da;
  --info: #3b6fe0; --info-soft: #e7eefd;

  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(20, 26, 51, .04), 0 8px 24px -8px rgba(20, 26, 51, .10);
  --shadow-lg: 0 18px 50px -12px rgba(40, 46, 120, .28);
  --font: "Heebo", "Assistant", system-ui, sans-serif;
  --display: "Rubik", "Heebo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 15px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
::selection { background: #cfd4ff; }

/* aurora background */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; background:
  radial-gradient(900px 520px at 85% -8%, rgba(18, 181, 166, .16), transparent 60%),
  radial-gradient(800px 600px at 10% 0%, rgba(91, 91, 240, .14), transparent 60%),
  radial-gradient(700px 520px at 40% 110%, rgba(255, 122, 89, .10), transparent 60%),
  var(--bg); }
.bg::after { content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(rgba(20, 26, 51, .07) 1px, transparent 1px); background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 70%); -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,.9), transparent 70%); }

/* ---- app shell ---- */
.app { display: grid; grid-template-columns: 268px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, var(--side) 0%, #0b1022 100%); color: var(--side-ink); padding: 22px 16px 16px;
  overflow: hidden; border-inline-start: 1px solid rgba(255,255,255,.04); }
.sidebar::before { content: ""; position: absolute; width: 260px; height: 260px; top: -120px; inset-inline-start: -80px;
  background: radial-gradient(circle, rgba(18,181,166,.35), transparent 65%); filter: blur(10px); pointer-events: none; }
.sidebar::after { content: ""; position: absolute; width: 240px; height: 240px; bottom: -110px; inset-inline-end: -90px;
  background: radial-gradient(circle, rgba(91,91,240,.35), transparent 65%); filter: blur(10px); pointer-events: none; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; padding: 4px 8px 16px; position: relative; z-index: 1; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 36px; height: 36px; border-radius: 11px; background: var(--grad); display: grid; place-items: center; color: #fff;
  box-shadow: 0 6px 18px -4px rgba(91,91,240,.6); flex: none; }
.brand-mark.big { width: 56px; height: 56px; border-radius: 16px; margin: 0 auto 14px; }
.brand-text { font: 700 20px/1 var(--display); letter-spacing: .2px; }
.brand-text b { background: linear-gradient(90deg, #6ee7d8, #a5b4fc); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700; }
.btn.new-site { position: relative; z-index: 1; justify-content: center; margin: 0 4px 12px; background: rgba(255,255,255,.08); color: #fff;
  border: 1px solid rgba(255,255,255,.12); }
.btn.new-site:hover { background: rgba(255,255,255,.14); }
.side-nav, .side-sites { display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }
.side-nav a, .side-sites a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px; color: var(--side-ink);
  font-weight: 500; font-size: 14.5px; transition: background .15s, color .15s; }
.side-nav a svg { width: 19px; height: 19px; flex: none; opacity: .85; }
.side-nav a:hover, .side-sites a:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.side-nav a.active, .side-sites a.active { background: linear-gradient(90deg, rgba(91,91,240,.28), rgba(18,181,166,.18)); color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.side-nav a.active svg { opacity: 1; color: #7dd3c8; }
.side-label { position: relative; z-index: 1; display: flex; justify-content: space-between; align-items: center; margin: 18px 12px 6px;
  font-size: 11.5px; font-weight: 700; letter-spacing: .08em; color: var(--side-muted); text-transform: uppercase; }
.side-label span { background: rgba(255,255,255,.08); color: var(--side-ink); border-radius: 99px; padding: 0 8px; font-size: 11px; letter-spacing: 0; }
.side-sites { flex: 1; overflow-y: auto; margin-inline-end: -6px; padding-inline-end: 6px; scrollbar-width: thin; scrollbar-color: #2a3358 transparent; }
.side-sites a { padding: 7px 10px; font-size: 14px; }
.side-sites a.off { opacity: .55; }
.side-site-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-off { font-size: 11px; color: var(--side-muted); }
.side-empty { color: var(--side-muted); font-size: 13px; padding: 0 12px; }
.pulse { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulse 1.6s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px rgba(52,211,153,0); } 100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); } }
.side-foot { position: relative; z-index: 1; border-top: 1px solid rgba(255,255,255,.07); padding-top: 10px; margin-top: 6px; }
.side-foot button { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; color: var(--side-muted);
  font: inherit; font-size: 14px; padding: 8px 12px; border-radius: 10px; cursor: pointer; }
.side-foot button:hover { background: rgba(255,255,255,.06); color: #fff; }

.main-col { min-width: 0; }
.mobile-bar, .scrim { display: none; }
.wrap { max-width: 1240px; margin: 0 auto; padding-left: max(28px, env(safe-area-inset-left, 0px)); padding-right: max(28px, env(safe-area-inset-right, 0px)); }
main.wrap { padding-top: 30px; padding-bottom: 70px; }

/* avatars (each site has its own hue) */
.avatar { --h: 230; width: 38px; height: 38px; border-radius: 11px; display: inline-grid; place-items: center; flex: none;
  font: 700 16px/1 var(--display); color: #fff;
  background: linear-gradient(135deg, hsl(var(--h) 80% 58%), hsl(calc(var(--h) + 40) 75% 50%)); box-shadow: 0 4px 12px -4px hsl(var(--h) 70% 45% / .6); }
.avatar.sm { width: 26px; height: 26px; border-radius: 8px; font-size: 12.5px; box-shadow: none; }

/* ---- type ---- */
h1 { font: 700 28px/1.2 var(--display); margin: 0 0 6px; letter-spacing: -.2px; text-wrap: balance; }
h2 { font: 600 17.5px/1.3 var(--display); margin: 0 0 16px; }
.sub { color: var(--muted); margin: 0 0 24px; }
.grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--accent); text-transform: uppercase; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.ltr { direction: ltr; text-align: left; }

/* ---- layout helpers ---- */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }
main.wrap > .row.spread { margin-bottom: 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-dash { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.panel { background: var(--panel); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9); outline: 1px solid var(--line); outline-offset: -1px;
  border-radius: var(--radius); padding: 22px; margin-bottom: 20px; box-shadow: var(--shadow); min-width: 0; overflow-x: auto; }
.panel > h2:first-child, .panel-head h2 { display: flex; align-items: center; gap: 10px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-head h2 { margin: 0; }
.h-ico { width: 30px; height: 30px; border-radius: 9px; display: inline-grid; place-items: center; flex: none; }
.h-ico svg { width: 17px; height: 17px; }
.h-ico.teal { background: #dcf6f2; color: var(--teal); }
.h-ico.indigo { background: var(--accent-soft); color: var(--indigo); }
.h-ico.coral { background: #ffece6; color: var(--coral); }
.h-ico.amber { background: var(--warn-soft); color: var(--amber); }
.h-ico.violet { background: #f0eafe; color: var(--violet); }

/* ---- hero & stats ---- */
.hero { position: relative; overflow: hidden; border-radius: 20px; padding: 26px 28px; margin-bottom: 20px; color: #fff;
  background: linear-gradient(120deg, #0f1733 0%, #1b2457 55%, #213a6b 100%); box-shadow: var(--shadow-lg); }
.hero::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(420px 240px at 12% 120%, rgba(18,181,166,.55), transparent 70%),
  radial-gradient(380px 260px at 95% -20%, rgba(139,92,246,.55), transparent 70%); }
.hero::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
  linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px); background-size: 32px 32px;
  mask-image: linear-gradient(90deg, transparent, #000 60%); -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); }
.hero > * { position: relative; z-index: 1; }
.hero h1 { color: #fff; margin-bottom: 4px; }
.hero .sub { color: #b9c2e6; margin: 0; }
.hero .btn.primary { background: #fff; color: #1b2457; box-shadow: none; }
.hero .btn.primary:hover { background: #eef0ff; }
.hero-meta { display: flex; gap: 22px; flex-wrap: wrap; margin-top: 18px; font-size: 13.5px; color: #c9d0ee; }
.hero-meta b { color: #fff; font: 600 15px var(--display); }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat { position: relative; overflow: hidden; background: var(--panel-solid); border-radius: var(--radius); padding: 18px 18px 16px;
  box-shadow: var(--shadow); outline: 1px solid var(--line); outline-offset: -1px; display: flex; flex-direction: column; gap: 10px; }
.stat::after { content: ""; position: absolute; inset-inline-end: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%;
  background: var(--c, var(--indigo)); opacity: .08; }
.stat .ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: #fff;
  background: var(--c, var(--indigo)); box-shadow: 0 8px 16px -6px var(--c, var(--indigo)); }
.stat .ico svg { width: 20px; height: 20px; }
.stat b { display: block; font: 700 30px/1 var(--display); font-variant-numeric: tabular-nums; }
.stat small { color: var(--muted); font-size: 13.5px; }
.stat.teal { --c: var(--teal); } .stat.indigo { --c: var(--indigo); } .stat.coral { --c: var(--coral); } .stat.violet { --c: var(--violet); }
.spark { display: flex; align-items: flex-end; gap: 3px; height: 34px; }
.spark i { flex: 1; background: var(--c, var(--indigo)); opacity: .25; border-radius: 3px 3px 1px 1px; min-height: 3px; }
.spark i.on { opacity: .9; }

/* ---- tables ---- */
.table-wrap { overflow-x: auto; margin: 0 -6px; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: right; padding: 12px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .03em; border-bottom-color: var(--line-2); }
tbody tr, table tr { transition: background .12s; }
table tr:hover td { background: rgba(91, 91, 240, .035); }
tr:last-child td { border-bottom: 0; }
.site-cell { display: flex; align-items: center; gap: 12px; min-width: 0; }
.site-cell a { color: var(--ink); font-weight: 600; }
.site-cell .small { margin-top: 1px; }

/* ---- buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line-2); background: var(--panel-solid); color: var(--ink);
  padding: 8px 15px; border-radius: 11px; cursor: pointer; font: 500 14px/1.3 var(--font); transition: transform .12s, box-shadow .15s, background .15s; }
.btn:hover { text-decoration: none; border-color: #c3c9de; box-shadow: 0 4px 12px -6px rgba(20,26,51,.25); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); border-color: transparent; color: #fff; box-shadow: 0 8px 20px -8px rgba(79,85,232,.7); }
.btn.primary:hover { box-shadow: 0 10px 24px -8px rgba(79,85,232,.85); filter: brightness(1.05); }
.btn.primary:disabled { opacity: .6; cursor: default; }
.btn.danger { color: var(--err); }
.btn.danger:hover { background: var(--err-soft); border-color: #f5c4cc; }
.btn.sm { padding: 5px 11px; font-size: 13px; border-radius: 9px; }
.btn.block { width: 100%; justify-content: center; padding: 11px; }
.btn.ghost { background: transparent; }
form.inline { display: inline; }

/* ---- badges ---- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: 12.5px; font-weight: 600;
  background: #eef0f6; color: #4b5270; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.badge.success, .badge.publish { background: var(--ok-soft); color: var(--ok); }
.badge.error { background: var(--err-soft); color: var(--err); }
.badge.running, .badge.queued, .badge.draft, .badge.pending { background: var(--warn-soft); color: var(--warn); }
.badge.off { background: #eef0f6; color: #7d839c; }
.badge.auto { background: var(--accent-soft); color: var(--accent); }
.badge.auto::before, .badge.off::before { display: none; }

/* ---- flash / notices ---- */
.flash { padding: 13px 16px; border-radius: 12px; margin-bottom: 20px; background: var(--ok-soft); color: #0b6e52; border: 1px solid #bfe9d8; word-break: break-word;
  display: flex; gap: 10px; align-items: flex-start; box-shadow: var(--shadow); }
.flash::before { content: "✓"; font-weight: 700; }
.flash.error { background: var(--err-soft); color: #b42339; border-color: #f6c6ce; }
.flash.error::before { content: "!"; }
.notice { background: linear-gradient(90deg, #fff6e2, #fffaf0); color: #7a5300; border: 1px solid #f4dfaa; padding: 11px 15px; border-radius: 12px; margin-bottom: 20px; }

/* ---- forms ---- */
label { display: block; font-weight: 600; font-size: 13.5px; margin: 0 0 6px; color: var(--ink-2); }
.field { margin-bottom: 16px; }
.hint { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-top: 5px; }
input[type=text], input[type=url], input[type=password], input[type=number], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 11px; font: inherit; background: #fff; color: var(--ink);
  transition: border-color .15s, box-shadow .15s; }
textarea { min-height: 88px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--indigo); box-shadow: 0 0 0 4px rgba(91,91,240,.14); }
input:disabled { background: #f2f3f8; color: var(--muted); }
input[type=file] { font: inherit; font-size: 13.5px; color: var(--muted); }
input[type=file]::file-selector-button { font: inherit; font-size: 13.5px; border: 1px solid var(--line-2); background: #fff; border-radius: 9px; padding: 6px 12px; margin-inline-end: 10px; cursor: pointer; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 500; margin-bottom: 11px; color: var(--ink); }
.check input { width: 18px; height: 18px; accent-color: var(--indigo); }
.days { display: flex; gap: 6px; flex-wrap: wrap; }
.days label { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line-2); padding: 7px 12px; border-radius: 10px; font-weight: 500; cursor: pointer; background: #fff; }
.days label:has(input:checked) { border-color: var(--indigo); background: var(--accent-soft); color: var(--accent); }
.days input { accent-color: var(--indigo); }
fieldset { border: 0; border-radius: var(--radius); padding: 24px 24px 10px; margin: 0 0 20px; background: var(--panel); box-shadow: var(--shadow);
  outline: 1px solid var(--line); outline-offset: -1px; min-width: 0; }
legend { float: right; width: 100%; font: 600 18px/1.3 var(--display); padding: 0; margin-bottom: 18px; }
legend + * { clear: both; }
h3.inner { font: 600 15.5px var(--display); margin: 24px 0 12px; padding-top: 20px; border-top: 1px dashed var(--line-2); }

/* tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; padding: 5px; background: rgba(255,255,255,.7); border-radius: 14px;
  box-shadow: var(--shadow); outline: 1px solid var(--line); outline-offset: -1px; }
.tab { border: 0; background: transparent; color: var(--ink-2); padding: 8px 14px; border-radius: 10px; font: 500 14px var(--font); cursor: pointer; transition: background .15s; }
.tab:hover { background: #f0f2fa; }
.tab.active { background: var(--grad); color: #fff; box-shadow: 0 6px 14px -6px rgba(79,85,232,.7); }
.tab .count { display: inline-block; min-width: 19px; padding: 0 6px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); font-size: 12px; margin-inline-start: 4px; }
.tab.active .count { background: rgba(255,255,255,.25); color: #fff; }
fieldset[hidden] { display: none; }

.field.sell textarea { border-color: #a9e4d3; background: #f5fcf9; }
.field.nosell textarea { border-color: #f6c3cb; background: #fff8f9; }
.field.sell label { color: var(--ok); }
.field.nosell label { color: var(--err); }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.choice { display: flex; gap: 12px; align-items: flex-start; border: 1px solid var(--line-2); border-radius: 13px; padding: 14px 16px; cursor: pointer; font-weight: 500; background: #fff; transition: all .15s; }
.choice:has(input:checked) { border-color: var(--indigo); background: var(--accent-soft); box-shadow: 0 0 0 3px rgba(91,91,240,.1); }
.choice input { margin-top: 4px; accent-color: var(--indigo); }
.choice b { display: block; }
.choice small { color: var(--muted); font-weight: 400; }
.logo-row { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 8px; }
.logo-preview { width: 150px; height: 86px; border: 1px dashed var(--line-2); border-radius: 12px; display: grid; place-items: center;
  background: repeating-conic-gradient(#eef0f6 0 25%, #fff 0 50%) 0 0 / 14px 14px; }
.logo-preview img { max-width: 128px; max-height: 68px; }
.save-bar { position: sticky; bottom: 12px; z-index: 5; display: flex; gap: 10px; padding: 12px; border-radius: 16px;
  background: rgba(255,255,255,.8); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: var(--shadow-lg); outline: 1px solid var(--line); }

/* ---- misc ---- */
pre.log { background: #0d1328; color: #cfd6f3; padding: 18px; border-radius: 14px; white-space: pre-wrap; direction: rtl;
  font: 13px/1.7 ui-monospace, "SF Mono", Menlo, monospace; max-height: 560px; overflow: auto; box-shadow: var(--shadow); }
details summary { cursor: pointer; color: var(--accent); font-size: 13px; }
.empty { text-align: center; color: var(--muted); padding: 30px 10px; }
.empty-ico { width: 54px; height: 54px; border-radius: 16px; margin: 0 auto 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--indigo); }

/* login */
.login { min-height: 100vh; display: grid; place-items: center; padding-block: 30px; }
.login-card { width: min(400px, 100%); text-align: center; background: rgba(255,255,255,.85); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-radius: 22px; padding: 34px 30px; box-shadow: var(--shadow-lg); outline: 1px solid var(--line); }
.login-card h1 { font-size: 30px; }
.login-card form { text-align: right; margin-top: 8px; }

/* up-next list on dashboard */
.upnext { display: flex; flex-direction: column; gap: 8px; }
.upnext a { display: flex; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 12px; background: #fff; outline: 1px solid var(--line); color: var(--ink); }
.upnext a:hover { text-decoration: none; outline-color: #c7cbf8; box-shadow: 0 6px 16px -10px rgba(79,85,232,.6); }
.upnext .when { width: 50px; flex: none; text-align: center; border-radius: 10px; padding: 5px 0; background: var(--accent-soft); color: var(--accent); line-height: 1.15; }
.upnext .when b { display: block; font: 700 18px var(--display); }
.upnext .when small { font-size: 11px; }
.upnext .what { min-width: 0; flex: 1; }
.upnext .what span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upnext .what small { color: var(--muted); }
.upnext .auto .when { background: #f0f1f6; color: var(--muted); }

/* ---- calendar ---- */
.cal-head h2 { margin: 0; }
.cal-legend { display: flex; flex-wrap: wrap; gap: 16px; color: var(--muted); margin: 12px 0 14px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 10px; height: 10px; border-radius: 4px; display: inline-block; background: var(--c); }
.dot.planned, .cal-item.planned { --c: var(--indigo); --bgc: #eef0ff; }
.dot.auto, .cal-item.auto, .cal-item.empty { --c: #9aa0b8; --bgc: #f4f5f9; }
.dot.review, .cal-item.review, .cal-item.running { --c: var(--amber); --bgc: #fff4dc; }
.dot.published, .cal-item.published { --c: var(--teal); --bgc: #e0f7f3; }
.dot.error, .cal-item.error { --c: var(--err); --bgc: var(--err-soft); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-dow { font-size: 12px; font-weight: 700; color: var(--muted); padding: 4px 8px; letter-spacing: .03em; }
.cal-day { min-height: 112px; padding: 7px; border-radius: 12px; background: #fff; outline: 1px solid var(--line); outline-offset: -1px;
  display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.cal-day.other { background: rgba(255,255,255,.45); }
.cal-day.other .cal-date { color: #b5b9cb; }
.cal-date { font: 600 13px var(--display); color: var(--ink-2); font-variant-numeric: tabular-nums; padding: 0 2px; }
.cal-day.today { outline: 2px solid var(--indigo); box-shadow: 0 8px 22px -12px rgba(79,85,232,.7); }
.cal-day.today .cal-date { color: var(--indigo); }
.cal-day.today .cal-date::after { content: " · היום"; font-weight: 500; }
.cal-dname { display: none; }
.cal-item { display: block; background: var(--bgc); border-inline-start: 3px solid var(--c); border-radius: 8px; padding: 5px 7px; color: var(--ink);
  font-size: 12.5px; line-height: 1.35; min-width: 0; transition: transform .12s, box-shadow .12s; }
.cal-item:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 14px -8px var(--c); }
.cal-item.auto, .cal-item.empty { border-inline-start-style: dashed; color: var(--muted); }
.cal-site { display: block; font-size: 11px; font-weight: 700; color: var(--c); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-title { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.cal-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }

/* documents & feedback */
.upload-row { margin-bottom: 12px; padding: 14px; border: 1.5px dashed var(--line-2); border-radius: 14px; background: rgba(255,255,255,.6); }
.upload-row input[type=file] { max-width: 100%; flex: 1; }
details.doc { border-radius: 12px; padding: 11px 15px; margin-top: 8px; background: #fff; outline: 1px solid var(--line); }
details.doc summary { color: var(--ink); font-size: 14px; }
details.doc form { margin-top: 10px; }
pre.learned { background: linear-gradient(135deg, #e6f8f4, #eceefe); color: #23346e; padding: 12px 14px; border-radius: 12px; white-space: pre-wrap;
  font: 14px/1.7 var(--font); margin: 4px 0 8px; }
.feedback-done { border-radius: 12px; padding: 14px 16px; background: #fff; outline: 1px solid var(--line); }

/* ---- responsive ---- */
@media (max-width: 1100px) {
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-dash { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset-block: 0; inset-inline-start: 0; width: 280px; z-index: 40; transform: translateX(105%);
    transition: transform .25s ease; padding-top: calc(22px + env(safe-area-inset-top, 0px)); }
  body.nav-open .sidebar { transform: none; box-shadow: var(--shadow-lg); }
  .scrim { display: block; position: fixed; inset: 0; background: rgba(13,19,40,.45); z-index: 30; opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .scrim { opacity: 1; pointer-events: auto; }
  .mobile-bar { display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 20;
    background: rgba(13,19,40,.92); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
    padding: calc(10px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px)); }
  .mobile-bar .brand { padding: 0; }
  .mobile-bar .brand-mark { width: 32px; height: 32px; border-radius: 10px; }
  .menu-btn { background: rgba(255,255,255,.08); border: 0; color: #fff; width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; cursor: pointer; }
  .wrap { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  main.wrap { padding-top: 20px; }
  h1 { font-size: 24px; }
  .hero { padding: 22px 20px; }
}
@media (max-width: 760px) {
  .grid2, .choices { grid-template-columns: 1fr; }
  .hide-sm { display: none; }
  table { font-size: 14px; }
  .panel, fieldset { padding: 18px 16px; }
  .cal-grid { display: block; }
  .cal-dow, .cal-day.empty, .cal-day.other { display: none; }
  .cal-day { min-height: 0; margin-bottom: 8px; padding: 10px; }
  .cal-dname { display: inline; }
}
@media (max-width: 480px) {
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 14px; }
  .stat b { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
