/* Palette, panels and components from the accepted mockups in makiety/ */
@font-face { font-family: "Plus Jakarta Sans"; src: url("../fonts/PlusJakartaSans.6b68a2205325.ttf") format("truetype"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("../fonts/Fraunces.df89c7ab0af2.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "JetBrains Mono"; src: url("../fonts/JetBrainsMono.4d05bb0e4a69.ttf") format("truetype"); font-weight: 100 800; font-display: swap; }
* { box-sizing: border-box; }
:root {
  --ink: #24343D; --text: #3A4A53; --muted: #66757E; --faint: #9AA7AE;
  --line: rgba(36, 52, 61, .09); --line2: rgba(36, 52, 61, .06);
  --panel: rgba(255, 255, 255, .74); --edge: rgba(255, 255, 255, .9);
  --accent: #3B77A6; --accent-dark: #2F5F86; --accent-soft: #E3EEF7;
  --ok: #5A9473; --ok-soft: #E2F1E8; --late: #C9773E; --late-soft: #FBF1E4;
  --shadow: 0 12px 32px rgba(52, 80, 96, .08), 0 1px 2px rgba(52, 80, 96, .06);
  --praca-bg: #DDE9F4; --praca: #2F5F86; --pryw-bg: #DDEEE1; --pryw: #3D6B4C; --hab-bg: #F5E7D6; --hab: #8A5A2E;
  --f-ui: "Plus Jakarta Sans", "Inter", system-ui, sans-serif;
  --f-head: "Fraunces", Georgia, "Noto Serif", serif;
  --f-mono: "JetBrains Mono", "DejaVu Sans Mono", monospace;
}
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; font-family: var(--f-ui); color: var(--text); font-size: 15px; line-height: 1.5; word-spacing: .05em; -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 620px at 8% 0%, #E2EFE5 0%, rgba(226, 239, 229, 0) 62%),
    radial-gradient(820px 720px at 92% 6%, #DCE9F4 0%, rgba(220, 233, 244, 0) 62%),
    radial-gradient(1000px 760px at 55% 108%, #E6EDEA 0%, rgba(230, 237, 234, 0) 62%),
    #F1F4F3; background-attachment: fixed; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { color: var(--ink); }
svg.i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

.panel { background: var(--panel); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); border: 1px solid var(--edge); border-radius: 20px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand .mark { width: 36px; height: 36px; flex: none; }
.brand .words { display: flex; flex-direction: column; }
.brand b { font: 700 21px/1 var(--f-ui); letter-spacing: -.035em; color: var(--ink); }
.brand b span { color: var(--accent); }
.brand small { font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-top: 7px; padding-left: 1px; }
.brand.big { gap: 14px; }
.brand.big .mark { width: 62px; height: 62px; }
.brand.big b { font-size: 38px; }

/* app shell */
.app { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 18px; padding: 18px; max-width: 1560px; margin: 0 auto; align-items: start; }
.side { padding: 16px 12px 14px; display: flex; flex-direction: column; min-height: calc(100vh - 36px); position: sticky; top: 18px; }
.side .brand { padding: 2px 8px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a, .nav span { display: flex; align-items: center; gap: 11px; height: 38px; padding: 0 12px; border-radius: 12px; color: #4A5A63; font-size: 14.5px; font-weight: 500; }
.nav a:hover { background: rgba(255, 255, 255, .6); text-decoration: none; }
.nav a svg.i, .nav span svg.i { color: #8597A0; }
.nav a.on { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 2px 8px rgba(52, 80, 96, .08); }
.nav a.on svg.i { color: var(--accent); }
.nav span.soon { color: var(--faint); }
.nav span.soon small { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--faint); }
.side h4 { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--faint); margin: 22px 12px 6px; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 14px 8px 2px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); min-width: 0; }
.me .who { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.me form { margin: 0; }
.av { width: 30px; height: 30px; border-radius: 50%; background: #DCE8F2; color: var(--accent-dark); font-size: 11px; font-weight: 700; display: grid; place-items: center; flex: none; border: 2px solid #fff; }
.main { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

/* page head and cards */
.head { padding: 10px 6px 0; }
.head h1 { font: 500 40px/1.1 var(--f-head); margin: 0; letter-spacing: -.02em; }
.head p { margin: 8px 0 0; color: var(--muted); }
.card { padding: 8px 22px 14px; }
.card h2 { font: 600 17px var(--f-ui); margin: 14px 0 8px; display: flex; align-items: center; gap: 9px; }
.card h2 .n { font-weight: 600; color: var(--faint); font-size: 13px; }
.row { display: flex; align-items: center; gap: 12px; min-height: 48px; border-top: 1px solid var(--line2); padding: 7px 0; }
.row .t { flex: 1; min-width: 0; }
.row .t small { display: block; color: var(--faint); font-size: 12.5px; }
.state { font-size: 12.5px; font-weight: 650; border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.state.ok { background: var(--ok-soft); color: #2F5E46; }
.state.off { background: var(--late-soft); color: #8A5A2E; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.capture { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 8px 10px; border-radius: 18px; background: #fff; box-shadow: var(--shadow); border: 1px solid var(--edge); }
.capture .plus { width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; border: 0; cursor: pointer; }
.capture .plus:hover { background: #D6E6F3; }
.capture .capture-text { flex: 1; min-width: 0; height: 40px; border: 0; padding: 0 4px; font-size: 15.5px; background: transparent; }
.capture .capture-text:focus { box-shadow: none; }
.capture .hint { font-size: 12.5px; color: var(--faint); white-space: nowrap; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 4px; }
.soon-list { margin: 0; padding: 0; list-style: none; }
.soon-list li { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-top: 1px solid var(--line2); }
.soon-list li b { display: block; color: var(--ink); font-weight: 650; }
.soon-list li span { color: var(--muted); font-size: 14px; }

/* buttons and forms, also used by the allauth element templates */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 12px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font: 650 14.5px var(--f-ui); cursor: pointer; text-decoration: none; box-shadow: 0 6px 16px rgba(59, 119, 166, .24); }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); text-decoration: none; }
.btn.outline, .btn.secondary, .btn.tertiary { background: #fff; color: var(--ink); border-color: var(--line); box-shadow: none; }
.btn.outline:hover, .btn.secondary:hover, .btn.tertiary:hover { background: #F4F7F8; }
.btn.link, .btn.cancel.link { background: none; border: 0; box-shadow: none; color: var(--accent); height: auto; padding: 6px 0; }
.btn.danger { background: #fff; color: #A4552A; border-color: #EBD2BF; box-shadow: none; }
.btn.small { height: 34px; padding: 0 12px; font-size: 13px; }
label { display: block; font-size: 13px; font-weight: 650; color: var(--text); margin-bottom: 6px; }
input[type=email], input[type=password], input[type=text], input[type=number], input:not([type]), textarea, select {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #D3DCE0; background: #fff; color: var(--ink); font: 500 15px var(--f-ui); }
textarea { height: auto; padding: 12px 14px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--ok); vertical-align: -3px; margin-right: 8px; }
input[type=checkbox] + label { display: inline; font-weight: 500; color: var(--muted); }
.errorlist { list-style: none; padding: 0; margin: 0 0 8px; color: #A4552A; font-size: 13.5px; font-weight: 600; }

/* messages */
.messages { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.messages li { padding: 12px 16px; border-radius: 14px; background: var(--accent-soft); color: var(--accent-dark); font-size: 14px; font-weight: 600; border: 1px solid rgba(59, 119, 166, .18); }
.messages li.success { background: var(--ok-soft); color: #2F5E46; border-color: rgba(90, 148, 115, .2); }
.messages li.warning, .messages li.error { background: var(--late-soft); color: #8A5A2E; border-color: rgba(201, 119, 62, .2); }

/* sign-in pages */
.entrance { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px max(16px, env(safe-area-inset-right, 0px)) 32px max(16px, env(safe-area-inset-left, 0px)); gap: 22px; }
.entrance-card { width: 100%; max-width: 420px; padding: 26px 26px 22px; }
.entrance-card h1 { font: 500 26px/1.2 var(--f-head); margin: 0 0 8px; letter-spacing: -.015em; }
.entrance-card p { margin: 0 0 14px; color: var(--muted); font-size: 14.5px; }
.entrance-card form p { margin: 0 0 14px; color: var(--text); }
.entrance-card form > button, .entrance-card form .btn:not(.link) { width: 100%; margin-top: 4px; }
.entrance-card form p.hint { margin: -6px 0 16px; font-size: 13.5px; }
.entrance-card hr { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.entrance-card .button-group { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.entrance-card .button-group .btn { width: 100%; }
.entrance-foot { color: var(--faint); font-size: 13px; margin: 0; text-align: center; }

/* account pages inside the app */
.manage { padding: 10px 26px 22px; }
.manage h1 { font: 500 30px/1.2 var(--f-head); margin: 14px 0 12px; letter-spacing: -.015em; }
.manage h2 { font: 600 17px var(--f-ui); margin: 0 0 6px; }
.manage section { border-top: 1px solid var(--line); padding: 16px 0 6px; }
.manage section ul { list-style: none; padding: 0; margin: 10px 0 0; display: flex; flex-wrap: wrap; gap: 10px; }
.manage p { color: var(--muted); }
.manage form p { color: var(--text); max-width: 480px; }
.manage table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 8px 0 14px; }
.manage th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--line); }
.manage td { padding: 10px 10px 10px 0; border-bottom: 1px solid var(--line2); vertical-align: top; }
.manage .button-group { display: flex; flex-wrap: wrap; gap: 10px; }
.manage img { max-width: 220px; border-radius: 12px; background: #fff; padding: 8px; }
.table-wrap { max-width: 100%; }

@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); padding: 12px max(12px, env(safe-area-inset-right, 0px)) 12px max(12px, env(safe-area-inset-left, 0px)); }
  .side { position: static; min-height: 0; }
  .nav { flex-direction: row; flex-wrap: wrap; }
  .side h4 { display: none; }
  .me { margin-top: 10px; }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .head h1 { font-size: 32px; }
  .capture small { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* planner pages, ported from the accepted mockups */
.seg { display: flex; background: #EEF2F3; border-radius: 12px; padding: 3px; font-size: 13.5px; flex: none; }
.seg label { margin: 0; cursor: pointer; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: block; padding: 7px 13px; border-radius: 9px; color: var(--muted); font-weight: 600; }
.seg input:checked + span { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(36, 52, 61, .1); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }
.side .search { display: flex; align-items: center; gap: 9px; height: 40px; margin: 0 4px 12px; padding: 0 10px; border-radius: 12px; background: rgba(255, 255, 255, .7); border: 1px solid var(--line); color: var(--faint); }
.side .search input { border: 0; height: 36px; padding: 0; background: transparent; font-size: 14px; }
.side .search input:focus { box-shadow: none; }
.brand-link { display: block; padding: 2px 8px 16px; text-decoration: none; }
.brand-link:hover { text-decoration: none; }
.side .brand { padding: 0; }
.proj { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 12px; border-radius: 10px; font-size: 13.8px; color: #4A5A63; white-space: nowrap; text-decoration: none; }
.proj:hover { background: rgba(255, 255, 255, .6); text-decoration: none; }
.proj .nm { overflow: hidden; text-overflow: ellipsis; }
.proj svg.i { width: 15px; height: 15px; color: var(--faint); margin-left: auto; }
.proj.on { background: #fff; color: var(--ink); font-weight: 650; box-shadow: 0 2px 8px rgba(52, 80, 96, .08); }
.side-empty { margin: 2px 12px; font-size: 13px; color: var(--faint); }
.nav .n { margin-left: auto; font-size: 12px; font-weight: 600; color: var(--faint); }
.nav a.on .n { color: var(--accent); background: var(--accent-soft); border-radius: 8px; padding: 1px 7px; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex: none; display: inline-block; }
/* area colours come from the palette of each area, set as --sec-* on .ar-<id> in app.html */
.dot { background: var(--sec-dot, #B9C3C8); }
.sek { font-size: 12px; font-weight: 650; border-radius: 999px; padding: 3px 10px; white-space: nowrap; text-decoration: none; }
a.sek:hover { text-decoration: none; filter: brightness(.97); }
.sek { background: var(--sec-bg, #E6EBEE); color: var(--sec-fg, #4E5D66); }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: #4E5D66; background: rgba(255, 255, 255, .9); border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px 3px 8px; white-space: nowrap; }
.chip svg.i { width: 13px; height: 13px; color: var(--muted); }
.chip .dot { width: 8px; height: 8px; }
.date { font-size: 13px; color: var(--muted); white-space: nowrap; font-weight: 500; min-width: 44px; text-align: right; }
.date.today { color: var(--accent); font-weight: 650; } .date.late { color: var(--late); font-weight: 650; }
.empty { color: var(--faint); font-size: 14px; margin: 6px 0 10px; }
.mono { font-family: var(--f-mono); font-size: 12px; font-weight: 500; }
.av.s { width: 26px; height: 26px; font-size: 10px; }

.row-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.head .h1-small { font-size: 32px; line-height: 1.2; }
.crumbs { display: flex; gap: 6px; align-items: center; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 8px !important; }
.crumbs svg.i { width: 14px; height: 14px; color: var(--faint); }
.pill { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border-radius: 999px; background: rgba(255, 255, 255, .8); border: 1px solid var(--edge); box-shadow: var(--shadow); font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; text-decoration: none; }
.pill svg.i { width: 16px; height: 16px; color: var(--accent); }
.dash { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 18px; align-items: start; }
.dash-main, .dash-side, .col { display: flex; flex-direction: column; gap: 18px; min-width: 0; }

.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.tile { border-radius: 20px; padding: 16px 18px 15px; border: 1px solid rgba(255, 255, 255, .8); box-shadow: var(--shadow); display: flex; flex-direction: column; color: var(--text); text-decoration: none; min-height: 124px; }
a.tile:hover { text-decoration: none; filter: brightness(.99); }
.tile .lab { font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.tile .big { font: 500 44px/1 var(--f-head); color: var(--ink); margin: 12px 0 6px; letter-spacing: -.02em; }
.tile .sub { font-size: 12.5px; color: var(--muted); }
.t-blue { background: linear-gradient(140deg, #E8F1F8 0%, #D5E5F1 100%); } .t-blue .lab svg.i { color: var(--accent); }
.t-sand { background: linear-gradient(140deg, #FBF1E4 0%, #F2DFC8 100%); } .t-sand .lab svg.i { color: var(--late); }
.t-grey { background: linear-gradient(140deg, #EEF2F4 0%, #DEE5E9 100%); } .t-grey .lab svg.i { color: #5F7480; }
.t-green { background: linear-gradient(140deg, #E6F2EA 0%, #D2E6D9 100%); } .t-green .lab svg.i { color: var(--ok); }

.card h2 .act { margin-left: auto; font-size: 13px; font-weight: 600; color: var(--accent); display: flex; align-items: center; gap: 4px; text-decoration: none; }
.card h2 .act svg.i { width: 15px; height: 15px; }
a.row { color: var(--text); text-decoration: none; }
a.row:hover { background: rgba(255, 255, 255, .55); text-decoration: none; }
.row > svg.i { color: var(--faint); }
.row .meta { display: flex; align-items: center; gap: 10px; flex: none; }
.row.task .t { color: var(--text); text-decoration: none; line-height: 1.4; }
.row.task .t:hover { color: var(--accent); }
.row.task.sub { padding-left: 30px; }
.cbf { margin: 0; display: flex; }
.cb { width: 21px; height: 21px; border: 1.7px solid #BCC7CD; border-radius: 50%; flex: none; background: #fff; cursor: pointer; padding: 0; }
.cb:hover { border-color: var(--ok); }
.cb.on { background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.3l3 3 6-6.6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100%; border-color: var(--ok); }
.row.done .t { color: var(--faint); text-decoration: line-through; text-decoration-color: #CBD3D7; }
.groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); border-top: 1px solid var(--line2); margin-top: 4px; }
.group { padding: 12px 14px 6px 0; min-width: 0; }
.group + .group { padding-left: 14px; border-left: 1px solid var(--line2); }
.group .gh { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.group .gh .n { font-size: 12.5px; color: var(--faint); font-weight: 600; }
.group .row { min-height: 40px; font-size: 13.8px; gap: 10px; }
.group .row:first-of-type { border-top: 0; }
.group .cb { width: 18px; height: 18px; }
.more { display: inline-block; margin: 6px 0; font-size: 13px; font-weight: 600; }

.covers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; padding: 4px 0 12px; }
.covers.wide { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); padding-top: 14px; }
.cover { border-radius: 16px; overflow: hidden; background: #fff; border: 1px solid var(--line); color: var(--text); text-decoration: none; display: flex; flex-direction: column; }
.cover:hover { text-decoration: none; box-shadow: var(--shadow); }
.cover .img { height: 84px; position: relative; display: block; }
.cover .ic { position: absolute; left: 12px; bottom: -14px; width: 34px; height: 34px; border-radius: 11px; background: #fff; display: grid; place-items: center; box-shadow: 0 3px 10px rgba(36, 52, 61, .12); color: var(--muted); }
.cover .body { padding: 20px 12px 12px; display: flex; flex-direction: column; flex: 1; }
.cover .body b { font-size: 14px; color: var(--ink); line-height: 1.35; font-weight: 650; }
.cover .body small { font-size: 12px; color: var(--faint); margin-top: 6px; }
.cover .foot { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: auto; padding-top: 10px; }
.cover .foot .chip { padding: 2px 8px 2px 7px; font-size: 12px; }
.cv1 { background: radial-gradient(120px 90px at 20% 30%, #CFE5D5 0%, transparent 70%), radial-gradient(160px 110px at 85% 70%, #CCDDEE 0%, transparent 70%), #E7EFEE; }
.cv2 { background: radial-gradient(130px 90px at 75% 25%, #CDE8DC 0%, transparent 70%), radial-gradient(150px 100px at 20% 80%, #D7E3F5 0%, transparent 70%), #E9F0F2; }
.cv3 { background: radial-gradient(140px 100px at 30% 20%, #D6E1E7 0%, transparent 70%), radial-gradient(130px 90px at 80% 85%, #F1E0C9 0%, transparent 70%), #EEF0EE; }
.cv4 { background: radial-gradient(130px 100px at 70% 30%, #FBE1C9 0%, transparent 70%), radial-gradient(140px 100px at 15% 75%, #F3E7CF 0%, transparent 70%), #F6EFE6; }
.waves { position: absolute; inset: 0; background: repeating-radial-gradient(circle at 110% 120%, rgba(255, 255, 255, 0) 0 14px, rgba(255, 255, 255, .45) 14px 15px); }

.cal { padding: 16px 18px 12px; }
.cal .top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal .top b { font: 600 18px var(--f-head); color: var(--ink); }
.cal .top span { display: flex; gap: 6px; }
.cal .top a { color: var(--muted); display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; }
.cal .top a:hover { background: rgba(255, 255, 255, .7); }
.days { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; row-gap: 3px; }
.days .h { font-size: 11px; font-weight: 700; color: var(--faint); padding-bottom: 6px; }
.days .d { font-size: 13px; font-weight: 500; color: var(--text); height: 34px; display: grid; place-items: center; position: relative; }
.days .d.o { color: #C4CDD2; }
.days .d.we { color: var(--muted); }
.days .d.now > span { width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }
.days .d i { position: absolute; bottom: 1px; left: 50%; width: 5px; height: 5px; border-radius: 50%; transform: translateX(-50%); background: var(--accent); }
.days .d i.l { background: var(--late); }
.due { border-top: 1px solid var(--line2); margin-top: 10px; padding-top: 4px; }
.due .r { display: flex; align-items: center; gap: 12px; padding: 8px 0; font-size: 13.5px; color: var(--text); text-decoration: none; }
.due .r:hover { text-decoration: none; color: var(--accent); }
.due .dd { width: 44px; flex: none; text-align: center; border-radius: 10px; background: #fff; border: 1px solid var(--line); padding: 3px 0 4px; }
.due .dd b { display: block; font: 600 16px/1.1 var(--f-head); color: var(--ink); }
.due .dd small { font-size: 10.5px; color: var(--faint); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.due .tx { flex: 1; min-width: 0; line-height: 1.35; }
.due .tx small { display: block; color: var(--faint); font-size: 12px; }
.src { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; flex: none; }
.src.mic { background: #E3EEF7; color: var(--accent); } .src.cam { background: #F5E7D6; color: #A8683A; } .src.link { background: #E1EEE5; color: #4E7F60; }
.btn.soft { background: var(--accent-soft); border-color: transparent; color: var(--accent); box-shadow: none; }
.btn.soft:hover { background: #D6E6F3; color: var(--accent-dark); }
.wide { width: 100%; margin: 6px 0 10px; }

.tabs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tabs.scroll { flex-wrap: wrap; }
.tabs a { padding: 7px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 600; color: var(--muted); background: rgba(255, 255, 255, .55); border: 1px solid var(--line); white-space: nowrap; text-decoration: none; }
.tabs a.on { background: #fff; color: var(--ink); border-color: var(--edge); box-shadow: 0 2px 8px rgba(52, 80, 96, .08); }
.tabs .sep { width: 1px; height: 22px; background: var(--line); margin: 0 4px; }
.inline-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0 6px; }
.inline-form input[type=text], .inline-form input:not([type]) { flex: 1 1 260px; }
.inline-form input[type=date], .inline-form select { flex: 0 1 auto; width: auto; min-width: 140px; }
.filter { display: flex; gap: 8px; padding: 12px 0 8px; }
.filter input { flex: 1; height: 38px; }
.pager { display: flex; align-items: center; gap: 12px; justify-content: center; padding: 14px 0 4px; font-size: 13.5px; color: var(--muted); }
.form-card { padding-top: 14px; padding-bottom: 18px; }
.form-card .field { margin: 0 0 14px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.field-row.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.help { display: block; color: var(--faint); font-size: 12.5px; margin: 4px 0 0; }
textarea { line-height: 1.55; resize: vertical; }

.project-head { overflow: hidden; }
.cover-hero { height: 150px; position: relative; overflow: hidden; }
.cover-hero .crumbs { position: absolute; top: 14px; left: 20px; background: rgba(255, 255, 255, .72); border-radius: 999px; padding: 5px 12px; backdrop-filter: blur(8px); }
.phead { padding: 0 26px 20px; position: relative; }
.ptile { width: 62px; height: 62px; border-radius: 18px; background: #fff; display: grid; place-items: center; box-shadow: 0 6px 18px rgba(36, 52, 61, .12); margin-top: -32px; position: relative; color: var(--praca); }
.ptile[class*=ar-] { color: var(--sec-fg); }
.phead .edit-btn { position: absolute; right: 26px; top: 16px; }
.phead h1 { font: 500 31px/1.2 var(--f-head); color: var(--ink); margin: 14px 0 14px; letter-spacing: -.015em; }
.fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 8px; }
.fields .chip { padding: 5px 12px 5px 10px; font-size: 13px; }
.status { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 650; padding: 5px 12px 5px 10px; border-radius: 999px; background: var(--ok-soft); color: #2F5E46; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.status.staly { background: #E3EEF7; color: var(--accent-dark); } .status.staly::before { background: var(--accent); }
.status.wstrzymany { background: #FBF1E4; color: #8A5A2E; } .status.wstrzymany::before { background: var(--late); }
.status.zamkniety { background: #EEF2F3; color: var(--muted); } .status.zamkniety::before { background: var(--faint); }
.pgrid { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.prose { font-size: 14.8px; line-height: 1.6; color: var(--text); overflow-wrap: anywhere; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--f-head); font-weight: 600; color: var(--ink); margin: 18px 0 6px; display: block; }
.prose h1 { font-size: 22px; } .prose h2 { font-size: 18px; } .prose h3, .prose h4 { font-size: 16px; }
.prose p { margin: 6px 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 6px 0 10px; }
.prose li.task-item { list-style: none; margin-left: -20px; }
.prose li.task-item input { margin-right: 6px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13.5px; margin: 10px 0; table-layout: auto; }
.prose td, .prose th { overflow-wrap: anywhere; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 6px 10px 6px 0; text-align: left; }
.prose code { font-family: var(--f-mono); font-size: 12.5px; background: #EEF2F3; border-radius: 6px; padding: 1px 5px; }
.prose pre { background: #EEF2F3; border-radius: 12px; padding: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.prose pre code { background: none; padding: 0; }
.prose blockquote { border-left: 3px solid #CFE0EE; margin: 8px 0; padding: 2px 0 2px 14px; color: var(--muted); }
.prose .missing { color: var(--faint); border-bottom: 1px dashed var(--faint); }
.prose img { max-width: 100%; border-radius: 10px; }
.nota h2 { margin-bottom: 4px; }
.logadd { display: flex; flex-direction: column; gap: 8px; border-radius: 14px; padding: 10px; margin: 6px 0 12px; background: #fff; border: 1px solid var(--line); }
.logadd textarea { border: 0; padding: 4px; min-height: 52px; }
.logadd textarea:focus { box-shadow: none; }
.logadd-bar { display: flex; gap: 8px; justify-content: flex-end; align-items: center; }
.logadd-bar input[type=date] { width: auto; height: 38px; }
.tl { position: relative; padding-left: 22px; margin-bottom: 8px; }
.tl::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: #DCE4E8; border-radius: 2px; }
.entry { position: relative; padding: 8px 0 10px; }
.entry::before { content: ""; position: absolute; left: -21px; top: 13px; width: 12px; height: 12px; border-radius: 50%; background: #fff; border: 2.5px solid var(--accent); }
.entry .d { font-size: 13px; font-weight: 700; color: var(--ink); display: flex; gap: 8px; align-items: center; }
.entry .d span { color: var(--faint); font-weight: 500; font-size: 12.5px; }
.entry .prose p { margin: 4px 0 0; }
.prog { display: flex; align-items: center; gap: 18px; padding: 18px 20px; flex-direction: row; min-height: 0; }
.ring { --p: 0; width: 78px; height: 78px; border-radius: 50%; background: conic-gradient(var(--ok) calc(var(--p) * 1%), rgba(90, 148, 115, .18) 0); display: grid; place-items: center; flex: none; }
.ring span { width: 60px; height: 60px; border-radius: 50%; background: #EAF3F8; display: grid; place-items: center; font: 600 18px var(--f-head); color: var(--ink); }
.prog b { display: block; font: 500 21px var(--f-head); color: var(--ink); }
.prog small { display: block; font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.hist { font-size: 13px; color: var(--muted); padding: 10px 0; border-top: 1px solid var(--line2); display: flex; gap: 10px; align-items: baseline; }
.hist b { color: var(--text); font-weight: 600; flex: 1; }
.share-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 0 4px; }
.share-form select { flex: 1 1 160px; width: auto; height: 38px; }
.share-box .row form { margin: 0; }
.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; margin: 4px 0 8px; }
.thumb { display: block; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #EEF2F3; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 10px 0 4px; font-size: 13px; }
.inbox-row { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line2); }
.inbox-row:first-child { border-top: 0; }
.inbox-row .t { flex: 1 1 260px; color: var(--text); text-decoration: none; font-weight: 500; }
.inbox-row .t small { display: block; color: var(--faint); font-size: 12.5px; font-weight: 400; }
.inbox-row .inline-form { padding: 0; }
.inbox-row select { height: 36px; min-width: 130px; }
.conflict { border: 1px solid #EBD2BF; background: #FFFBF6; }
.btn.danger svg.i { color: #A4552A; }

@media (max-width: 1180px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .covers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .capture .hint { display: none; }
}
@media (max-width: 900px) {
  .groups, .pgrid, .field-row, .field-row.three { grid-template-columns: minmax(0, 1fr); }
  .group + .group { padding-left: 0; border-left: 0; border-top: 1px solid var(--line2); }
  .capture { flex-wrap: wrap; }
  .capture .capture-text { flex-basis: calc(100% - 60px); }
  .phead .edit-btn { position: static; margin-top: 12px; }
}

/* sort menu, list row actions, overdue tasks */
.head-acts { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sorter { position: relative; }
.sorter summary { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 14px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 13.5px; font-weight: 600; color: var(--text); cursor: pointer; list-style: none; white-space: nowrap; }
.sorter summary::-webkit-details-marker { display: none; }
.sorter summary svg.i { color: var(--accent); }
.sorter[open] summary { border-color: var(--edge); box-shadow: 0 2px 8px rgba(52, 80, 96, .08); }
.sorter-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 240px; padding: 6px; border-radius: 14px; background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); display: flex; flex-direction: column; }
.sorter-menu a { padding: 9px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--text); text-decoration: none; }
.sorter-menu a:hover { background: #F4F7F8; text-decoration: none; }
.sorter-menu a.on { color: var(--accent); font-weight: 650; background: var(--accent-soft); }
.note-row .t { color: var(--text); text-decoration: none; line-height: 1.4; }
.note-row .t:hover { color: var(--accent); }
.row-acts { display: flex; align-items: center; gap: 6px; }
.row-acts form { margin: 0; }
.row-acts .btn.small { height: 32px; padding: 0 10px; gap: 6px; }
.row.task.late { box-shadow: inset 3px 0 0 var(--late); padding-left: 10px; background: linear-gradient(90deg, var(--late-soft), rgba(251, 241, 228, 0) 70%); }
.row.task.sub.late { padding-left: 30px; }
.late-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 650; color: #8A5A2E; background: var(--late-soft); border: 1px solid rgba(201, 119, 62, .25); border-radius: 999px; padding: 2px 9px 2px 7px; white-space: nowrap; }
.late-badge svg.i { color: var(--late); }
.tabs a.late-tab { display: inline-flex; align-items: center; gap: 6px; }
.tabs a.late-tab .n { font-size: 12px; font-weight: 700; color: #fff; background: var(--late); border-radius: 999px; padding: 0 7px; line-height: 18px; }
@media (max-width: 760px) {
  .row-acts .btn span, .sorter summary span { display: none; }
  .row-acts .btn.small { width: 34px; padding: 0; }
  .note-row .chip { display: none; }
  .late-badge { font-size: 11.5px; }
}

/* habits */
.week-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 6px 0 6px; }
.week-top h2 { margin: 0 4px; }
.week-top .act { font-size: 13px; font-weight: 600; }
.week-top .week-rate { margin-left: auto; font-size: 13px; font-weight: 650; color: var(--ok); background: var(--ok-soft); border-radius: 999px; padding: 3px 11px; }
.nav-arrow { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: var(--muted); border: 1px solid var(--line); background: #fff; }
.nav-arrow:hover { color: var(--accent); text-decoration: none; }
.nav-arrow.off { visibility: hidden; }
table.habits { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.habits th, .habits td { padding: 6px 4px; text-align: center; border-top: 1px solid var(--line2); }
.habits thead th { border-top: 0; font-size: 11px; font-weight: 700; color: var(--faint); text-transform: uppercase; letter-spacing: .06em; }
.habits thead th.day span { display: block; }
.habits thead th.day b { display: block; font-size: 15px; color: var(--ink); letter-spacing: 0; text-transform: none; }
.habits thead th.we b { color: var(--muted); }
.habits thead th.now b { color: var(--accent); }
.habits th.nm { text-align: left; font-weight: 600; color: var(--ink); min-width: 140px; position: sticky; left: 0; background: rgba(255, 255, 255, .92); z-index: 1; }
.habits thead th.nm { color: var(--faint); font-weight: 700; }
.habits th.nm a { color: var(--ink); text-decoration: none; }
.habits th.nm a:hover { color: var(--accent); }
.habits td.now { background: rgba(227, 238, 247, .55); }
.habits td.st, .habits th.st { width: 64px; font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.habits td.st.hot { color: var(--ok); }
.habits td form { margin: 0; display: flex; justify-content: center; }
.hb { width: 30px; height: 30px; border-radius: 9px; border: 1.7px solid #C7D1D6; background: #fff; cursor: pointer; padding: 0; display: block; }
.hb:hover { border-color: var(--ok); }
.hb.on { background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.3l3 3 6-6.6' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 80% no-repeat; border-color: var(--ok); }
.hb.off { background: repeating-linear-gradient(135deg, #F3F6F7, #F3F6F7 4px, #fff 4px, #fff 8px); border-style: dashed; cursor: default; margin: 0 auto; }
.habits tfoot th, .habits tfoot td { font-size: 12px; }
.dayn { font-weight: 650; color: var(--faint); }
.dayn.some { color: var(--text); }
.dayn.full { color: #fff; background: var(--ok); border-radius: 999px; padding: 1px 7px; }
.field-active { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 0; }
.field-active .help { flex-basis: 100%; }

/* archive, areas, delete page */
.archived-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 18px; background: #F4F1EA; border-color: #E8DFCD; color: #6B5A3A; font-size: 14px; font-weight: 600; }
.archived-bar form { margin: 0 0 0 auto; }
@media (min-width: 901px) { .side h4 { display: flex; align-items: center; } }
.h4-add { margin-left: auto; color: var(--faint); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; }
.h4-add:hover { color: var(--accent); background: rgba(255, 255, 255, .7); }
.choice { border: 0; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; gap: 8px; }
.choice legend { font-weight: 650; color: var(--ink); margin-bottom: 6px; font-size: 14px; }
.choice .radio { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text); cursor: pointer; }
.choice .radio input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
.actions form { margin: 0; }
@media (max-width: 760px) {
  .habits th, .habits td { padding: 5px 1px; }
  .habits th.nm { min-width: 86px; max-width: 96px; font-size: 12.5px; line-height: 1.25; padding-right: 4px; }
  .habits thead th.day b { font-size: 14px; }
  .hb { width: 26px; height: 26px; border-radius: 8px; }
  .week-top .week-rate { margin-left: 0; }
}

/* top bar, always on screen */
.topbar { position: sticky; top: 10px; z-index: 30; display: flex; align-items: center; gap: 6px; padding: 6px; border-radius: 16px; }
.tb { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border-radius: 11px; font-size: 13.5px; font-weight: 600; color: var(--text); text-decoration: none; }
.tb:hover { background: #fff; color: var(--accent); text-decoration: none; }
.tb.on { background: #fff; color: var(--ink); box-shadow: 0 2px 8px rgba(52, 80, 96, .08); }
.tb svg.i { color: var(--accent); }
.tb.up { margin-left: auto; }
.tb.up svg.i { transform: rotate(-90deg); }
@media (max-width: 900px) {
  .topbar { top: 6px; }
}
@media (max-width: 760px) {
  .tb.up span { display: none; }
}

/* top bar search and inbox, habits on the Today page */
.tb-n { font-size: 11.5px; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: 0 7px; line-height: 18px; }
.search-page { display: flex; align-items: center; gap: 10px; padding: 10px 12px 10px 16px; }
.search-page svg.i { color: var(--faint); }
.search-page input { flex: 1; border: 0; background: transparent; height: 40px; font-size: 16px; }
.search-page input:focus { box-shadow: none; outline: none; }
.habit-today h2 .n.all { color: #fff; background: var(--ok); border-radius: 999px; padding: 0 8px; }
.hchips { display: flex; flex-wrap: wrap; gap: 7px; padding: 4px 0 8px; }
.hchips form { margin: 0; }
.hchip { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid var(--line); background: #fff; font: 600 13px var(--f-ui); color: var(--text); cursor: pointer; }
.hchip::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 1.6px solid #BCC7CD; flex: none; }
.hchip:hover { border-color: var(--ok); }
.hchip.on { background: var(--ok-soft); border-color: rgba(90, 148, 115, .35); color: #2F5E46; }
.hchip.on::before { background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.3l3 3 6-6.6' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100%; border-color: var(--ok); }
@media (max-width: 600px) {
  .tb span { display: none; }
  .tb { padding: 0 11px; }
}
.head-btns { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.head-btns form { margin: 0; }
.pchip { max-width: 220px; }
.pchip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 1180px) { .pchip { max-width: 160px; } }
@media (max-width: 600px) {
  .row.task { flex-wrap: wrap; row-gap: 4px; }
  .row.task .t { flex-basis: calc(100% - 40px); }
  .row.task .meta { width: 100%; padding-left: 33px; flex-wrap: wrap; gap: 6px 8px; }
  .row.task .meta .date { min-width: 0; text-align: left; }
  .pchip { max-width: 100%; }
}
/* the details of a task move under its text when the text would get too narrow */
.row.task { flex-wrap: wrap; row-gap: 2px; }
.row.task .t { flex: 1 1 220px; min-width: 0; }
.row.task .meta { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.row .t { overflow-wrap: anywhere; }

/* sharing: a person or a group, chosen apart */
.share-form { align-items: center; }
.share-form .pick-person, .share-form .pick-group { flex: 1 1 200px; display: flex; }
.share-form .pick-person select, .share-form .pick-group select { flex: 1; }
.share-form:has(input[name=kind][value=osoba]:checked) .pick-group { display: none; }
.share-form:has(input[name=kind][value=grupa]:checked) .pick-person { display: none; }
.share-row .t small .warn { color: #8A5A2E; font-weight: 600; }
.who-ico { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); flex: none; }
.share-row form { margin: 0; }
.link-card input { width: 100%; height: 42px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line); background: #fff; }

/* no scroll bars anywhere: the week shows the counts under the habit name on a phone */
.habits .hstats { display: none; font-size: 11.5px; font-weight: 500; color: var(--muted); margin-top: 2px; }
.habit-week { container-type: inline-size; }
@container (max-width: 640px) {
  .habits .st { display: none; }
  .habits .hstats { display: block; }
}
@media (max-width: 760px) {
  .tabs a { padding: 6px 11px; font-size: 13px; }
}
.tb { white-space: nowrap; }
@media (max-width: 1240px) { .tb span { display: none; } .tb { padding: 0 11px; } }
.share-form select { min-width: 0; max-width: 100%; }
.share-form .pick-person, .share-form .pick-group { flex: 1 1 100%; min-width: 0; }
.share-form .pick-person .help { margin: 0; }
/* every list row: the details move under the text when the text would get too narrow */
.row { flex-wrap: wrap; row-gap: 2px; }
.row .t { flex: 1 1 200px; min-width: 0; }
.row .meta { margin-left: auto; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.row .t small { overflow-wrap: anywhere; }
.card h2 { flex-wrap: wrap; row-gap: 4px; }
.upload input[type=file] { max-width: 100%; min-width: 0; flex: 1 1 100%; font-size: 12.5px; }

/* areas: palette swatches for the area form, the same colours as PALETTES in planner/models.py */
.pal-niebieski { --sec-fg: #2F5F86; --sec-bg: #DDE9F4; --sec-dot: #86ACD0; }
.pal-zielony { --sec-fg: #3D6B4C; --sec-bg: #DDEEE1; --sec-dot: #8DBE9C; }
.pal-piaskowy { --sec-fg: #8A5A2E; --sec-bg: #F5E7D6; --sec-dot: #E0AE7C; }
.pal-fioletowy { --sec-fg: #5B4A86; --sec-bg: #E8E3F4; --sec-dot: #A799D0; }
.pal-czerwony { --sec-fg: #8A3B3B; --sec-bg: #F6E0E0; --sec-dot: #D99696; }
.pal-turkusowy { --sec-fg: #2E6B6B; --sec-bg: #DAEFEE; --sec-dot: #86C2BF; }
.pal-zloty { --sec-fg: #7A6420; --sec-bg: #F5EDCF; --sec-dot: #D9C27A; }
.pal-szary { --sec-fg: #4E5D66; --sec-bg: #E6EBEE; --sec-dot: #A9B5BC; }
.inline-choice { flex-direction: row; flex-wrap: wrap; gap: 8px 10px; }
.inline-choice legend { width: 100%; }
.swatch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.swatch input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.swatch .ico { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--text); }
.tabs a .dot { margin-right: 6px; }
.hint-inline { font-size: 12.5px; font-weight: 500; color: var(--faint); }
/* the open tasks by area wrap into rows, so the groups part with lines on top instead of on the side */
.groups { gap: 0 22px; border-top: 0; }
.group, .group + .group { padding: 12px 0 6px; border-left: 0; border-top: 1px solid var(--line2); }
.group .row.task .t { flex-basis: 110px; }

/* the area blocks on Today: one block per area in a single row, all as tall as the tallest
   (grid rows stretch their items), with task titles cut to three lines so one long title
   does not stretch the whole row; on a narrow card the blocks stack */
.groups-wrap { container-type: inline-size; margin-top: 8px; }
.groups, .groups.cols-1, .groups.cols-2, .groups.cols-3, .groups.cols-4 { display: grid; grid-template-columns: minmax(0, 1fr); align-items: stretch; gap: 14px; border-top: 0; margin-top: 0; }
@container (min-width: 560px) {
  .groups.cols-2, .groups.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .groups.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.group, .group + .group { display: flex; flex-direction: column; padding: 12px 12px 8px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .55); }
.group .gh { padding-bottom: 6px; border-bottom: 1px solid var(--line2); margin-bottom: 0; }
.group .row.task { flex-wrap: wrap; align-items: flex-start; padding: 8px 0; }
.group .row.task .cbf { padding-top: 1px; }
.group .row.task .t { flex: 1 1 calc(100% - 32px); }
.group .row.task .meta { width: 100%; margin-left: 0; padding-left: 28px; justify-content: flex-start; }
.group .row.task .meta:empty { display: none; }
.group .row.task .t.clamp { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.group .more { margin-top: auto; padding-top: 8px; }

/* the search field above the note list looks like the other fields */
.filter { display: flex; gap: 8px; align-items: center; padding: 4px 0 8px; }
.filter input[type=search] { flex: 1; min-width: 0; height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; font: 500 14px var(--f-ui); color: var(--text); }
.filter input[type=search]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* alignment pass: a repeated element keeps one column in every row of a list, controls side by side
   share one height, cards side by side share one height */
:where(input[type=date], input[type=search], input[type=url], input[type=time]) {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #D3DCE0; background: #fff; color: var(--ink); font: 500 15px var(--f-ui); }
input[type=date]::-webkit-calendar-picker-indicator { opacity: .5; cursor: pointer; }
input[type=file] { font: 500 13px var(--f-ui); color: var(--muted); }
input[type=file]::file-selector-button { height: 34px; padding: 0 12px; margin-right: 10px; border-radius: 10px; border: 1px solid var(--line); background: #fff; color: var(--ink); font: 650 13px var(--f-ui); cursor: pointer; }
input[type=file]::file-selector-button:hover { background: #F4F7F8; }

.inline-form :is(input, select), .logadd-bar :is(input, select), .share-form select, .filter input[type=search], .inbox-row select { height: 40px; }
.inline-form .btn, .logadd-bar .btn, .share-form .btn, .filter .btn, .search-page .btn { height: 40px; }
.inline-form { container-type: inline-size; }
.inline-form > input[type=date] { flex: 0 1 170px; width: auto; min-width: 150px; }
.inline-form > select { flex: 1 1 200px; width: auto; min-width: 0; }
.inline-form > .btn { flex: none; }
@container (max-width: 640px) {
  .inline-form:has(> input[type=date]) > input[name=title] { flex-basis: 100%; }
  .inline-form > input[type=date] { flex: 1 1 150px; }
}
.inbox-row .inline-form { flex: 1 1 100%; }
.inbox-row select[name$="-kind"] { flex: 0 1 210px; }
.inbox-row select[name$="-project"] { flex: 1 1 260px; }

.date { font-variant-numeric: tabular-nums; }
.row > .date, .row .meta > .date, .row .meta > .when { flex: none; text-align: right; }
/* a fixed date column only where something stands left of it and has to keep its column too */
.row .meta:has(> .pslot, > .chip) > :is(.date, .when) { width: 96px; }
.when { display: flex; flex-direction: column; align-items: flex-end; justify-content: center; line-height: 1.3; }
.late-note { font-size: 11.5px; font-weight: 650; color: var(--late); white-space: nowrap; }
.pslot { width: 200px; flex: none; display: flex; min-width: 0; }
.pslot .pchip { max-width: 100%; }
.note-row .meta > .chip { width: 116px; flex: none; justify-content: center; }
.share-row .meta > .chip.who { width: 200px; flex: none; min-width: 0; }
.chip.who .nm { overflow: hidden; text-overflow: ellipsis; }
.chip.lvl { width: 72px; flex: none; justify-content: center; }
@media (max-width: 1180px) { .pslot { width: 160px; } }

/* a task row keeps its tick box and date on the first line of the title, also when the title wraps */
.row.task { align-items: flex-start; padding-top: 13px; padding-bottom: 14px; }
.row.task .meta { min-height: 21px; align-items: center; }
.row.task .meta .chip { margin: -2px 0; }
.row.task .when { min-height: 21px; }

/* the Today blocks put the date under the title, from its first letter */
.group .row.task .when { width: auto; flex-direction: row; align-items: baseline; gap: 8px; }
.group .row.task .when .date { width: auto; text-align: left; }

@media (max-width: 600px) {
  .pslot { width: auto; }
  .row .meta > .when, .row .meta > .date { width: auto; }
  .row.task .when { flex-direction: row; align-items: baseline; gap: 8px; }
  .row.task .when .date { text-align: left; }
}

.grid2 { align-items: stretch; }
.row-head > :first-child { flex: 1 1 420px; min-width: 0; }

/* tabs that do not fit one line wrap into lines of even length, not a full line and a single tab */
.tabs { display: block; text-wrap: balance; font-size: 0; margin-bottom: -6px; }
.tabs > a, .tabs > .sep { display: inline-flex; align-items: center; vertical-align: middle; margin: 0 6px 6px 0; }
.tabs > .sep { margin: 0 10px 6px 4px; }

.hchips { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 6px; }
.hchips form { display: flex; }
.hchip { width: 100%; height: 34px; justify-content: flex-start; border-radius: 10px; }

.choice legend { padding: 0; }
.manage th { white-space: nowrap; }
/* in a narrow card the date stays beside the title instead of dropping under it in some rows only */
.row.task .t, .share-row .t { flex-basis: 140px; }
@media (max-width: 600px) {
  /* on a phone the details go under the title: the project from the first letter of the title, the date at the right edge */
  .row.task .meta { justify-content: flex-start; margin-left: 0; }
  .row.task .meta > .when { margin-left: auto; }
  .row.task .meta > .pslot { max-width: calc(100% - 104px); }
  .pslot .pchip { min-width: 0; }
}
/* account pages: the title is above the card (planner tag page_with_head), so the card starts with its first section */
.manage { padding: 20px 26px 22px; }
.manage > :first-child { margin-top: 0; }
.manage > section:first-child { border-top: 0; padding-top: 0; }
