:root {
  color-scheme: light;
  --wine: #531f32;
  --wine-dark: #3c1324;
  --cream: #f7f2eb;
  --ink: #271f22;
  --subtle: #65565b;
  --line: #e5dadb;
  font: 100%/1.5 system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
.wrap { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.masthead { color: white; background: var(--wine); }
.top { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 76px; }
.brand { font: 1.65rem Georgia, serif; letter-spacing: .14em; }
.brand span { display: inline-block; font: .875rem system-ui, sans-serif; letter-spacing: 0; margin-left: .55rem; }
.masthead .outline { color: white; border-color: #b68b9a; }
main { padding-block: clamp(2rem, 6vw, 4.5rem); }
h1, h2, h3, p { margin: 0; }
h1, h2 { font: 400 clamp(2.2rem, 5vw, 4rem)/1.08 Georgia, serif; color: var(--wine-dark); }
h2 { font-size: 2rem; }
.eyebrow { color: var(--subtle); margin-bottom: .55rem; }
.heading { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 2rem; }
.views, .actions, .task-actions, .task-meta { display: flex; flex-wrap: wrap; gap: .5rem; }
.views { margin-bottom: 1.15rem; }
button, input, select, textarea { font: inherit; }
button, input, select, textarea { border-radius: .55rem; }
button { min-height: 44px; padding: .5rem .85rem; border: 1px solid var(--wine); color: white; background: var(--wine); cursor: pointer; }
button:hover:not(:disabled) { box-shadow: inset 0 0 0 1px currentColor; }
button:disabled { opacity: .6; cursor: wait; }
button.outline, .view { color: var(--wine); background: transparent; border-color: var(--line); }
.view[aria-pressed="true"] { color: white; background: var(--wine); border-color: var(--wine); }
.view span { margin-left: .45rem; font-variant-numeric: tabular-nums; }
.panel { background: white; border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 3vw, 1.75rem); }
.login { max-width: 31rem; margin: 4vh auto; }
.login p, dialog p { color: var(--subtle); }
.login > *, dialog form > * { margin-bottom: .85rem; }
form { display: grid; }
form label { margin-bottom: .75rem; }
label { display: grid; gap: .3rem; color: var(--subtle); font-size: .9rem; }
input, textarea, select { width: 100%; min-width: 0; min-height: 44px; padding: .52rem .65rem; border: 1px solid #aa969d; color: var(--ink); background: white; font-size: 1rem; }
select { appearance: none; padding-right: 1.8rem; background: linear-gradient(45deg, transparent 50%, var(--wine) 50%) calc(100% - 14px) 50% / 5px 5px no-repeat, linear-gradient(135deg, var(--wine) 50%, transparent 50%) calc(100% - 9px) 50% / 5px 5px no-repeat, white; }
.check { display: flex; align-items: center; gap: .55rem; margin-top: .5rem; }
.check input { width: 20px; min-height: 28px; }
.filters { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: .75rem; }
.toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .65rem; padding-block: .85rem; border-bottom: 1px solid var(--line); }
#refresh-time, .task-meta, .automation { font-size: .875rem; color: var(--subtle); }
[role="status"]:empty { display: none; }
.workspace [role="status"] { padding-top: .7rem; }
.error { color: #982341 !important; }
.tasks { list-style: none; padding: 0; margin: 0; }
.task { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: start; gap: .85rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.task:last-child { border-bottom: 0; }
.task h3 { font: 1.35rem Georgia, serif; margin: .25rem 0; overflow-wrap: anywhere; }
.task p { white-space: pre-wrap; overflow-wrap: anywhere; }
.task-meta span + span::before { content: "·"; margin-right: .5rem; }
.task-actions button { font-size: .875rem; }
.done { width: 44px; padding: 0; font-size: 1.25rem; }
.done[aria-pressed="true"] { background: var(--cream); }
.source, a { color: var(--wine); text-underline-offset: .15em; }
.source { display: inline-flex; align-items: center; min-height: 44px; }
.empty { padding-block: 1rem .25rem; color: var(--subtle); }
dialog { width: min(550px, calc(100% - 24px)); max-height: calc(100% - 24px); border: 1px solid var(--line); border-radius: 1rem; padding: clamp(1rem, 4vw, 1.75rem); }
dialog::backdrop { background: #28151dc2; }
dialog .actions { justify-content: flex-end; margin-bottom: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .75rem; }
:focus-visible { outline: 2px solid #a43561; outline-offset: 3px; }
@media (max-width: 600px) {
  .wrap { width: calc(100% - 24px); }
  .top { min-height: 64px; }
  .brand { font-size: 1.35rem; }
  .brand span { display: block; margin-left: 0; }
  .heading { align-items: start; flex-direction: column; }
  .filters { grid-template-columns: 1fr 1fr; }
  .filters label:first-child { grid-column: 1 / -1; }
  .task { grid-template-columns: auto minmax(0, 1fr); }
  .task-actions { grid-column: 2; }
}
@media (max-width: 360px) {
  .filters, .form-grid { grid-template-columns: 1fr; }
}
