:root {
  --ink: #3D3029; --paper: #FFFFFF; --linen: #FAF5EE; --line: #EADBC8; --taupe: #86746A;
  --rose: #C27A57; --rose-dark: #A65D3D; --blush: #E9C7B1; --sage: #A3AB8E; --sage-dark: #6F7A5A;
  --shadow: 0 1px 2px rgba(61, 48, 41, .06), 0 10px 30px -18px rgba(61, 48, 41, .35);
  --display: "Fraunces", Georgia, serif;
  --body: "Jost", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--linen); color: var(--ink); font: 15px/1.55 var(--body); }
h1, h2, h3 { font-family: var(--display); font-weight: 400; margin: 0; line-height: 1.15; }
h1 { font-size: 30px; } h2 { font-size: 22px; } h3 { font-size: 18px; font-weight: 600; }
.muted { color: var(--taupe); }
code { font-size: .9em; background: var(--linen); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
a { color: var(--rose-dark); }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); font: 500 14px var(--body); cursor: pointer; text-decoration: none; }
.btn:hover { border-color: var(--taupe); }
.btn-primary { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn-primary:hover { background: var(--rose-dark); border-color: var(--rose-dark); }
.btn-sm { min-height: 32px; padding: 4px 10px; font-size: 13px; }
.btn-danger { color: #A33A2A; }
.btn:disabled { opacity: .55; cursor: default; }
.link { border: 0; background: none; color: var(--rose-dark); cursor: pointer; font: inherit; padding: 0; text-decoration: underline; }

.field { display: grid; gap: 4px; }
.field > span { font-size: 13px; font-weight: 500; color: var(--taupe); }
input, textarea, select { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; width: 100%; }
textarea { resize: vertical; min-height: 84px; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px rgba(194, 122, 87, .18); }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; }
.check input { width: auto; }

.login { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.login-card { width: min(420px, 100%); background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 32px 28px; display: grid; gap: 16px; box-shadow: var(--shadow); }
.login-msg { margin: 0; min-height: 1.5em; font-size: 14px; }

.bar { position: sticky; top: 0; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; padding: 10px 20px; background: var(--paper); border-bottom: 1px solid var(--line); }
.brand { font-family: var(--display); font-weight: 400; font-size: 20px; }
.brand small { font-family: var(--body); font-size: 12px; color: var(--taupe); margin-left: 4px; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 8px 14px; border-radius: 8px; font: 500 15px var(--body); color: var(--taupe); cursor: pointer; display: inline-flex; gap: 6px; align-items: center; }
.tabs button:hover { color: var(--ink); background: var(--linen); }
.tabs button.is-active { color: var(--ink); background: var(--linen); box-shadow: inset 0 -2px 0 var(--rose); }
.tabs em { font-style: normal; font-size: 12px; font-weight: 600; background: var(--rose); color: #fff; border-radius: 999px; padding: 0 7px; }
.who { margin-left: auto; font-size: 13px; color: var(--taupe); }

.view { max-width: 1100px; margin: 0 auto; padding: 24px 20px 80px; }
.view.is-wide { max-width: 1500px; }
.head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.stack { display: grid; gap: 16px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.row-end { display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hint { font-size: 13px; color: var(--taupe); margin: 0; }
@media (max-width: 720px) { .grid2 { grid-template-columns: 1fr; } .view { padding: 16px 12px 80px; } .who { margin-left: 0; } }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 8px 0 -4px; }
.item { border: 1px solid var(--line); border-radius: 12px; padding: 16px; display: grid; gap: 12px; background: var(--linen); }
.item-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.item-head strong { font-family: var(--display); font-weight: 600; font-size: 17px; margin-right: auto; }
.thumb { width: 92px; height: 70px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); }
.photo-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

.savebar { position: sticky; bottom: 0; z-index: 20; margin-top: 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); }

.photos > .hint, .photos > .muted, .photos > p { grid-column: 1 / -1; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.photo { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: grid; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.photo div { padding: 8px 10px; display: flex; gap: 6px; justify-content: space-between; align-items: center; font-size: 12px; color: var(--taupe); }
.drop { display: grid; justify-items: center; gap: 10px; border: 2px dashed var(--line); border-radius: 14px; padding: 32px 20px; text-align: center; background: var(--paper); cursor: pointer; }
.drop svg { width: 40px; height: 40px; color: var(--rose); }
.drop strong { font-size: 17px; font-weight: 500; }
.drop:hover { border-color: var(--rose); }
.drop.is-over { border-color: var(--rose); background: #FFF7F1; }

table.list { width: 100%; border-collapse: collapse; font-size: 14px; }
table.list th, table.list td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-weight: 500; color: var(--taupe); font-size: 13px; }
.tablewrap { overflow-x: auto; }
.pill { display: inline-block; font-size: 12px; padding: 1px 9px; border-radius: 999px; background: var(--linen); border: 1px solid var(--line); }
.pill.ok { background: #EEF1E6; border-color: #C9D0B6; color: #4E5A38; }
.pill.wait { background: #FBF1E3; border-color: #EBD3AE; color: #7A5A22; }
.pill.off { color: var(--taupe); }
.stats { display: flex; gap: 12px; flex-wrap: wrap; }
.stat { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; min-width: 130px; }
.stat b { display: block; font-family: var(--display); font-size: 26px; font-weight: 400; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--taupe); }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100; background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; font-size: 14px; max-width: calc(100vw - 32px); box-shadow: var(--shadow); }
.toast.is-error { background: #A33A2A; }
.confirm { border: 1px solid var(--line); border-radius: 14px; padding: 22px; max-width: 420px; box-shadow: var(--shadow); }
.confirm::backdrop { background: rgba(61, 48, 41, .35); }
.confirm p { margin: 0 0 18px; }

.sec { padding: 0; }
.sec > summary { list-style: none; display: flex; align-items: center; gap: 12px; padding: 16px 20px; cursor: pointer; }
.sec > summary::-webkit-details-marker { display: none; }
.sec > summary strong { font-family: var(--display); font-weight: 400; font-size: 19px; margin-right: auto; }
.sec > summary::after { content: "›"; font-size: 22px; color: var(--taupe); transition: transform .15s; }
.sec[open] > summary::after { transform: rotate(90deg); }
.sec[open] > summary { border-bottom: 1px solid var(--line); }
.sec-no { width: 28px; height: 28px; border-radius: 50%; background: var(--linen); border: 1px solid var(--line); display: grid; place-items: center; font-size: 13px; color: var(--taupe); flex: none; }
.sec-body { padding: 18px 20px 20px; }
.thumb.big { width: 180px; height: 120px; }
.link.small { font-size: 12px; margin-left: 6px; }
.field > span .pill { font-size: 11px; padding: 0 7px; }
.page-h { margin: 22px 0 10px; }
.pick-h { margin: 16px 0 10px; font-size: 15px; }
@media (max-width: 720px) { .sec > summary .hint { display: none; } .thumb.big { width: 100%; height: auto; aspect-ratio: 3 / 2; } }

.sub-row { grid-template-columns: auto 1fr auto; align-items: center; }
.sub-meta { display: grid; gap: 2px; min-width: 0; }
.sub-meta strong { font-family: var(--display); font-weight: 600; font-size: 17px; }
.sub-meta .hint { overflow-wrap: anywhere; }
.thumb-empty { display: block; background: repeating-linear-gradient(45deg, var(--linen), var(--linen) 6px, var(--paper) 6px, var(--paper) 12px); }
.sub-photo input { padding: 5px 8px; font-size: 13px; }
.sub-photo > div:last-child { justify-content: flex-start; }
details.panel > summary { cursor: pointer; }
@media (max-width: 720px) { .sub-row { grid-template-columns: auto 1fr; } .sub-row > .row { grid-column: 1 / -1; } }
.gal { margin-bottom: 4px; }
