/* Shared colours, fonts and themes come from packages/design-tokens (copied here as tokens.css by build.mjs). Only app-specific rules live below. */
@import url("tokens.css");
* { box-sizing: border-box; }
body { margin: 0; font: 16px/1.5 var(--font-body); color: var(--text); background: var(--bg); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.5rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1rem; }
a { color: var(--link); }
.muted { color: var(--muted); }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }

.btn { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); padding: .55em 1.05em; border-radius: var(--radius-control); font: inherit; font-weight: 600; cursor: pointer; }
.btn:hover { filter: brightness(.93); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--link); }
.btn.danger { background: var(--card); color: var(--danger); border-color: var(--danger); }
.btn.small { padding: .25em .7em; font-size: .85rem; }
button.link { background: none; border: 0; color: var(--link); padding: 0; cursor: pointer; font: inherit; text-decoration: underline; }
input[type=text], input[type=email], input[type=search], input[type=password], input[type=date], select, textarea {
  width: 100%; padding: .5em .65em; border: 1px solid var(--input-border); border-radius: var(--radius-control); font: inherit; background: var(--input-bg); color: var(--text);
}
textarea { min-height: 6em; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
label.fld { display: block; margin: 0 0 .9rem; }
label.fld > .lbl { display: block; font-weight: 600; margin-bottom: .25rem; font-size: .92rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 0 1rem; }
@media (max-width: 600px) { .grid2, .grid3 { grid-template-columns: 1fr; } }

.top { display: flex; align-items: center; gap: 1.25rem; padding: .7rem 1.25rem; background: var(--header-bg); color: #fff; flex-wrap: wrap; }
.top strong { font-size: 1.05rem; }
.top nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }
.top nav button { background: none; border: 0; color: #d1d5db; font: inherit; padding: .3em .7em; border-radius: 6px; cursor: pointer; }
.top nav button.active, .top nav button:hover { color: #fff; background: rgba(255,255,255,.14); }
.top .who { color: #d1d5db; font-size: .9rem; }
.top .who button { color: #d1d5db; }
.page { max-width: 960px; margin: 0 auto; padding: 1.25rem 1.25rem 4rem; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; margin-bottom: 1.25rem; }
.between { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.between h1, .between h2 { margin: 0; }
.toolbar { display: flex; gap: .75rem; flex-wrap: wrap; align-items: center; margin-bottom: 1rem; }
.toolbar > input[type=search] { flex: 1 1 200px; width: auto; }
.toolbar > select { width: auto; }
.toolbar label { display: flex; gap: .4rem; align-items: center; font-size: .92rem; white-space: nowrap; }
.login { max-width: 360px; margin: 12vh auto; }
.error-box { background: var(--error-bg); border: 1px solid var(--error-border); color: var(--danger); padding: .6rem .85rem; border-radius: var(--radius-control); margin-bottom: 1rem; }

/* task list */
.group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); margin: 1.4rem 0 .4rem; }
.group-title.overdue { color: var(--danger); }
.task { display: flex; gap: .75rem; align-items: flex-start; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem .9rem; margin-bottom: .45rem; cursor: pointer; }
.task:hover { border-color: var(--link); }
.task input[type=checkbox] { width: 1.15rem; height: 1.15rem; margin-top: .25rem; flex: none; cursor: pointer; }
.task .main { flex: 1; min-width: 0; }
.task .title { font-weight: 600; overflow-wrap: anywhere; }
.task.done .title { text-decoration: line-through; color: var(--muted); }
.meta { display: flex; gap: .4rem .75rem; flex-wrap: wrap; font-size: .85rem; color: var(--muted); margin-top: .15rem; }
.pill { display: inline-block; padding: .05em .55em; border-radius: var(--radius-pill); font-size: .75rem; font-weight: 600; }
.pill.high { background: var(--pill-full-bg); color: var(--pill-full-fg); }
.pill.low { background: var(--pill-past-bg); color: var(--pill-past-fg); }
.pill.doing { background: var(--amber-bg); color: var(--amber-text); }
.pill.overdue { background: var(--pill-full-bg); color: var(--pill-full-fg); }
.pill.today { background: var(--amber-bg); color: var(--amber-text); }
.empty { text-align: center; color: var(--muted); padding: 2.5rem 1rem; }

/* detail dialog */
dialog { border: 1px solid var(--line); border-radius: var(--radius); padding: 0; width: min(680px, 94vw); max-height: 92vh; background: var(--card); color: var(--text); }
dialog::backdrop { background: rgba(0,0,0,.45); }
dialog .body { padding: 1.25rem; overflow-y: auto; max-height: calc(92vh - 4rem); }
dialog .foot { display: flex; gap: .5rem; justify-content: space-between; padding: .8rem 1.25rem; border-top: 1px solid var(--line); }
.thread { border-top: 1px solid var(--line); margin-top: 1.25rem; padding-top: 1rem; }
.comment { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-control); padding: .5rem .75rem; margin-bottom: .5rem; }
.comment .who { font-size: .82rem; color: var(--muted); }
.log { font-size: .85rem; color: var(--muted); margin: .15rem 0; }

table.grid { border-collapse: collapse; width: 100%; font-size: .92rem; }
table.grid th, table.grid td { text-align: left; padding: .5rem .6rem; border-bottom: 1px solid var(--line); }
table.grid th { font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
.toast { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); background: var(--header-bg); color: #fff; padding: .6rem 1rem; border-radius: var(--radius-control); z-index: 10; }
