:root {
  color-scheme: light;
  --canvas: #f6f6f7;
  --surface: #fff;
  --ink: #19191b;
  --muted: #68686e;
  --line: #e5e5e8;
  --soft: #f1f1f3;
  --radius: 14px;
  --shadow: 0 4px 20px rgba(0,0,0,.035);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--canvas); color: var(--ink); font: 14px/1.55 -apple-system,BlinkMacSystemFont,"Inter","Segoe UI",sans-serif; -webkit-font-smoothing: antialiased; }
header { display: flex; align-items: center; justify-content: space-between; gap: 16px; background: var(--surface); border-bottom: 1px solid var(--line); padding: 17px max(28px,calc((100% - 1120px)/2)); min-height: 76px; }
header > div { display: grid; gap: 1px; }
header strong { font-size: 14px; font-weight: 750; letter-spacing: -.025em; }
header small { color: var(--muted); font-size: 12px; }
main { width: 100%; max-width: 1176px; margin: 0 auto; padding: 44px 28px; flex: 1; }
h1,h2 { margin: 0; font-weight: 650; line-height: 1.18; letter-spacing: -.045em; }
h1 { font-size: 30px; }
h2 { font-size: 23px; }
p { margin: 8px 0; color: var(--muted); }
button,input,select,textarea { font: inherit; }
button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; cursor: pointer; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink); padding: 9px 15px; font-weight: 600; min-height: 40px; transition: background .15s,border-color .15s,box-shadow .15s; }
button:hover { background: var(--soft); }
button:disabled { opacity: .5; cursor: wait; }
.primary { background: var(--ink); color: white; border-color: var(--ink); }
.primary:hover { background: #38383b; border-color: #38383b; }
:focus-visible { outline: 2px solid #555; outline-offset: 3px; }
input,select,textarea { width: 100%; min-width: 0; min-height: 43px; padding: 10px 12px; border: 1px solid #dedee2; border-radius: 8px; background: var(--surface); color: var(--ink); transition: border-color .15s,box-shadow .15s; }
input::placeholder,textarea::placeholder { color: #818187; }
input:focus,select:focus,textarea:focus { outline: none; border-color: #94949b; box-shadow: 0 0 0 3px #ededf0; }
textarea { resize: vertical; }
label { display: grid; gap: 6px; font-size: 13px; font-weight: 600; margin: 14px 0; }
.heading,.toolbar,.actions { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#dashboard > .heading { margin-bottom: 25px; }
#new { padding: 11px 18px; }
nav { display: flex; gap: 4px; width: fit-content; max-width: 100%; padding: 4px; border: 1px solid var(--line); border-radius: 10px; background: #ebebed; }
nav button { border-color: transparent; background: transparent; color: #66666c; min-height: 35px; padding: 7px 17px; font-size: 13px; }
nav button:hover { background: #e4e4e7; color: var(--ink); }
nav button[aria-pressed=true] { background: var(--surface); color: var(--ink); border-color: var(--line); box-shadow: 0 1px 3px #0000000a; }
.toolbar { margin: 22px 0 15px; }
.toolbar input { max-width: 440px; }
#login { width: min(100%,420px); margin: clamp(30px,9vh,100px) auto 0; padding: 36px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
#login h1 { font-size: 28px; }
#login form { margin-top: 25px; }
#login button { width: 100%; margin-top: 8px; min-height: 45px; }
#orders { display: grid; gap: 9px; }
.order { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: start; text-align: left; gap: 14px; padding: 19px 22px; width: 100%; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); font-weight: 400; box-shadow: var(--shadow); }
.order:hover { background: #fcfcfc; border-color: #bdbdc3; }
.order > div:first-child { display: grid; gap: 3px; min-width: 0; overflow-wrap: anywhere; }
.order strong { font-size: 17px; font-weight: 650; letter-spacing: -.025em; }
.order small,.muted { color: var(--muted); font-size: 12px; }
.order .description { margin-top: 4px; white-space: pre-wrap; overflow-wrap: anywhere; color: #55555b; }
.tags { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; align-content: start; }
.tag { padding: 4px 9px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); color: #505056; font-size: 11px; font-weight: 600; white-space: nowrap; }
.tag.dark { background: #27272a; color: white; border-color: #27272a; }
.empty { min-height: 190px; display: grid; place-content: center; padding: 32px; text-align: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--muted); }
dialog { width: min(580px,calc(100% - 28px)); max-height: 90dvh; padding: 28px; overflow: auto; border: 1px solid var(--line); border-radius: 18px; color: var(--ink); box-shadow: 0 20px 70px #0003; }
dialog::backdrop { background: #15151955; backdrop-filter: blur(3px); }
dialog .heading { padding-bottom: 17px; margin-bottom: 10px; border-bottom: 1px solid var(--line); }
#close { font-size: 23px; line-height: 1; min-width: 36px; min-height: 36px; padding: 3px; border: 0; }
.actions { justify-content: flex-end; margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--line); }
#message,#form-message { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
#message:empty,#form-message:empty { display: none; }
main:has(#login:not([hidden])) #message { max-width: 420px; margin: 14px auto; text-align: center; }
footer { padding: 18px 28px; color: var(--muted); text-align: center; font-size: 11px; }
@media(max-width: 600px) {
 header { min-height: 66px; padding: 12px 16px; }
 main { padding: 25px 16px; }
 h1 { font-size: 24px; }
 #new { padding: 9px 12px; white-space: nowrap; }
 nav { width: 100%; }
 nav button { flex: 1; padding: 7px 5px; font-size: 12px; }
 .toolbar { margin: 16px 0 12px; }
 .order { grid-template-columns: 1fr; padding: 16px; }
 .tags { justify-content: flex-start; }
 #login { padding: 25px; }
 dialog { padding: 20px; }
}
@media(prefers-reduced-motion:reduce) { * { transition: none; } }
