@font-face {
  font-family: Montserrat;
  src: url("/_static/montserrat-latin-700-normal.woff2") format("woff2");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #181818;
  --surface: #202020;
  --control: #292929;
  --hover: #363636;
  --border: #4b4b4b;
  --text: #f2f2f2;
  --muted: #bdbdbd;
  --invert: #1b1b1b;
  --selected: #3c3c3c;
  --error: #ffb3b3;
  --focus: #fafafa;
}

:root[data-theme="light"] {
  color-scheme: light;
  --background: #f6f6f6;
  --surface: #fff;
  --control: #f2f2f2;
  --hover: #e8e8e8;
  --border: #aaa;
  --text: #171717;
  --muted: #505050;
  --invert: #fff;
  --selected: #dedede;
  --error: #a00000;
  --focus: #161616;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--background); color: var(--text); font: .9rem/1.45 system-ui, sans-serif; }
a { color: inherit; }
h1, h2, h3, p, ul { margin: 0 0 .6rem; }
h1, h2, h3 { line-height: 1.2; overflow-wrap: anywhere; }
h1 { font-size: 1.4rem; }
h2 { font-size: 1.05rem; }
h3 { font-size: .9rem; }
.muted { color: var(--muted); font-size: .82rem; }
.error { color: var(--error); }
.wrap { overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; }
.is-done { opacity: .72; }
.is-done strong, .is-done .sticker-title { text-decoration: line-through; }

button, input, select, textarea {
  font: inherit;
  color: var(--text);
  background: var(--control);
  border: 1px solid var(--border);
  border-radius: .35rem;
  padding: .3rem .5rem;
}
button { cursor: pointer; }
button:hover:not(:disabled) { background: var(--hover); }
button:disabled { color: var(--muted); opacity: .55; cursor: default; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.primary { background: var(--text); color: var(--invert); border-color: var(--text); font-weight: 650; }
.primary:hover:not(:disabled) { background: var(--muted); }
.danger { color: var(--error); border-color: var(--error); }
input, select, textarea { min-width: 0; max-width: 100%; }
input:is([type="color"], [type="checkbox"]) { padding: 0; }
input[type="color"] { min-width: 3rem; }
textarea { resize: vertical; }
form { display: grid; gap: .6rem; justify-items: start; margin-bottom: .7rem; }
form > label:not(.inline), fieldset { width: 100%; min-width: 0; }
label { display: grid; min-width: 0; gap: .2rem; }
.inline { display: flex; align-items: center; gap: .4rem; }
.actions { display: flex; gap: .3rem; flex-wrap: wrap; align-items: end; }
form .actions { max-width: 100%; }

.topbar {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  align-items: center;
  min-height: 3rem;
  padding: .45rem .9rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.brand { font: 700 1rem Montserrat, system-ui, sans-serif; text-decoration: none; }
#account-dropdown { position: relative; min-width: 0; }
#account-toggle { max-width: 100%; overflow-wrap: anywhere; }
#account-menu {
  position: absolute;
  z-index: 5;
  right: 0;
  min-width: 11rem;
  top: calc(100% + .25rem);
  padding: .25rem;
  border: 1px solid var(--border);
  border-radius: .45rem;
  background: var(--surface);
}
#account-menu button { display: block; width: 100%; text-align: left; border-color: transparent; background: none; }
#account-menu a { display: block; padding: .3rem .5rem; border: 1px solid transparent; border-radius: .35rem; text-decoration: none; }
#account-menu a:is(:hover, [aria-current="page"]) { background: var(--hover); }
#account-menu svg { height: 1em; width: 1em; vertical-align: -.12em; fill: currentColor; }
:root[data-theme="dark"] .moon, :root[data-theme="light"] .sun { display: none; }
.toolbar { display: flex; justify-content: space-between; gap: .5rem; align-items: center; padding: .45rem .7rem; }
#notice { overflow-wrap: anywhere; }

.workspace { display: grid; gap: .55rem; grid-template-columns: minmax(11rem, .8fr) minmax(14rem, 1.12fr) minmax(24rem, 2.25fr); padding: 0 .7rem; align-items: start; }
.pane, .login, dialog { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: .5rem; padding: .7rem; min-width: 0; }
.login { width: min(24rem, calc(100% - 1.4rem)); margin: 2rem auto; }
.admin-page { width: min(52rem, calc(100% - 1.4rem)); margin: 1.5rem auto; }
.admin-list { list-style: none; padding: 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; margin-bottom: .55rem; }
.section-head :is(h2,h3) { margin: 0; }
.dot { display: inline-block; width: .72em; height: .72em; flex: none; margin-right: .4em; vertical-align: .03em; border-radius: 50%; background: var(--accent); outline: 1px solid var(--border); }
.area { border-top: 1px solid var(--border); padding: .5rem 0; }
.project-link { width: 100%; text-align: left; margin-top: .25rem; overflow-wrap: anywhere; }
.project-link[aria-current="true"] { background: var(--selected); font-weight: 650; }
.row { padding: .45rem .5rem; margin-bottom: .45rem; border: 1px solid var(--border); border-radius: .35rem; }
.row .actions { margin-top: .3rem; }
.tags { display: flex; flex-wrap: wrap; gap: .25rem; margin: .3rem 0; font-size: .77rem; overflow-wrap: anywhere; }
.tags > span { background: var(--control); padding: .03rem .3rem; border-radius: .3rem; }
.planner > section + section { margin-top: .9rem; }
.inbox-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(11rem, 100%), 1fr)); gap: .35rem; min-height: 3rem; padding: .35rem; border: 1px dashed var(--border); border-radius: .35rem; }
.dragging :is(.inbox-list, .calendar-scroll) { outline: 1px dashed var(--focus); outline-offset: -1px; }
.sticker {
  --tint: color-mix(in srgb, var(--accent) 21%, var(--surface));
  min-width: 0;
  border: 1px solid var(--surface);
  border-inline-start: 4px solid var(--accent);
  border-radius: .32rem;
  background: var(--tint);
  overflow: hidden;
}
.inbox-sticker { padding: .25rem; }
.inbox-sticker .actions { margin-top: .2rem; }
.sticker-title { display: block; text-align: left; width: 100%; font-weight: 650; padding: .1rem .25rem; border: none; background: transparent; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.sticker-title:focus-visible { outline-offset: -2px; }
.sticker-details { display: block; font-size: .72rem; line-height: 1.2; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; padding: 0 .25rem; }
.calendar-scroll { overflow: auto; max-height: min(62vh, 48rem); border: 1px solid var(--border); border-radius: .3rem; }
.calendar-grid { display: grid; grid-template-columns: minmax(0, 1fr); }
.calendar-grid.columns-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calendar-day + .calendar-day { border-left: 1px solid var(--border); }
.day-name { position: sticky; top: 0; z-index: 2; margin: 0; padding: .35rem; background: var(--control); border-bottom: 1px solid var(--border); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-grid { position: relative; }
.hour-line { position: absolute; inset-inline: 0; border-top: 1px solid var(--border); color: var(--muted); font-size: .65rem; padding-inline-start: .18rem; white-space: nowrap; pointer-events: none; }
.day-stickers { position: absolute; inset: 0 0 0 3rem; pointer-events: none; }
.calendar-sticker { position: absolute; padding-top: 3px; pointer-events: auto; }
.calendar-sticker .sticker-title { line-height: 1.15; padding-block: 0; }
.resize-handle { position: absolute; inset-inline: 0; height: 5px; cursor: ns-resize; touch-action: none; }
.resize-handle:hover { background: var(--accent); }
.resize-handle.start { top: 0; }
.resize-handle.end { bottom: 0; }

dialog { width: min(31rem, calc(100% - 1.4rem)); max-height: 90dvh; overflow: auto; }
dialog::backdrop { background: rgb(0 0 0 / 60%); }
dialog form { margin-bottom: 0; }
#dialog-notice:empty { margin: 0; }
fieldset { display: grid; gap: .35rem; border: 1px solid var(--border); border-radius: .35rem; margin: 0; }
fieldset button { justify-self: start; }
.checklist-edit { display: grid; gap: .35rem; }
.checklist-edit input[type="text"] { flex: 1 1 auto; }
.checklist-read { padding-inline-start: 1.3rem; overflow-wrap: anywhere; }
footer { color: var(--muted); padding: .6rem .7rem; font-size: .75rem; }
footer span { margin-left: .5rem; }

@media (max-width: 1050px) {
  .workspace { grid-template-columns: minmax(11rem, 1fr) minmax(14rem, 1.65fr); }
  .planner { grid-column: 1 / -1; }
}
@media (max-width: 720px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .calendar-scroll { max-height: 65vh; }
}
