:root {
  color-scheme: light;
  font-family: system-ui, sans-serif;
  color: #17231f;
  background: #f4f6f2;
  --green: #155d40;
  --border: #d7dfd8;
  --muted: #505e55;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
.shell { width: min(100% - 2rem, 68rem); margin-inline: auto; }
.topbar { background: #171d1a; color: #f5f8f4; }
.topbar-content, .account, .brand { display: flex; align-items: center; gap: .75rem; }
.topbar-content { justify-content: space-between; min-height: 4rem; padding-block: .5rem; flex-wrap: wrap; }
.brand { margin: 0; font-weight: 730; letter-spacing: -.025em; }
.brand-mark {
  display: grid; place-items: center; width: 2rem; height: 2rem;
  background: #c9f27e; color: #17231f; border-radius: .45rem;
}
.account { font-size: .875rem; overflow-wrap: anywhere; flex-wrap: wrap; }
main { padding-block: clamp(2rem, 6vw, 5rem); }
h1 { font-size: clamp(1.9rem, 4vw, 3.25rem); line-height: 1.08; letter-spacing: -.055em; margin: 0 0 1.5rem; }
h2, h3 { margin: 0 0 1rem; line-height: 1.2; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1rem; }
p { line-height: 1.5; }
.login, .panel { background: white; border: 1px solid var(--border); border-radius: 1rem; padding: clamp(1rem, 3vw, 2rem); }
.login { max-width: 32rem; margin-inline: auto; }
.dashboard-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 1rem; align-items: start; }
form { display: grid; gap: .85rem; justify-items: start; }
#create-room, #invite-member { border-top: 1px solid var(--border); padding-top: 1.1rem; margin-top: 1.1rem; }
label { display: grid; gap: .35rem; width: 100%; font-size: .92rem; font-weight: 650; }
input, select, button { font: inherit; }
input, select { background: white; color: inherit; width: 100%; }
input, select, button { min-height: 2.75rem; padding: .55rem .8rem; border: 1px solid #a4b2a8; border-radius: .5rem; }
button { background: var(--green); color: white; border-color: var(--green); font-weight: 650; cursor: pointer; }
button:disabled { opacity: .65; cursor: wait; }
button.secondary { background: white; color: #234035; border-color: #a4b2a8; }
:focus-visible { outline: 3px solid #40845f; outline-offset: 3px; }
ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
#rooms button { text-align: left; width: 100%; overflow-wrap: anywhere; }
#rooms button[aria-pressed="true"] { background: #e5f3e9; border-color: var(--green); }
.members li { display: flex; align-items: center; gap: .6rem; justify-content: space-between; flex-wrap: wrap; padding-bottom: .5rem; }
.members li span { overflow-wrap: anywhere; }
small { display: block; color: var(--muted); font-size: .875rem; }
.notice { border: 1px solid #a4b2a8; background: white; border-radius: .5rem; padding: .85rem 1rem; margin: 0 0 1.5rem; }

@media (max-width: 700px) {
  .dashboard-layout { grid-template-columns: 1fr; }
}

textarea { font: inherit; color: inherit; background: white; width: 100%; resize: vertical; padding: .55rem .8rem; border: 1px solid #a4b2a8; border-radius: .5rem; }
.muted { color: var(--muted); }
.batch-list { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
.batch-button { text-align: left; width: 100%; height: 100%; overflow-wrap: anywhere; }
.batch-button[aria-pressed="true"] { background: #e5f3e9; border-color: var(--green); }
.batch-button small { margin-top: .25rem; }
.new-batch, .manage-access, .batch-details { border-top: 1px solid var(--border); margin-top: 1.35rem; padding-top: 1rem; }
details summary { cursor: pointer; font-weight: 650; color: #244d3c; }
details[open] > summary { margin-bottom: .85rem; }
.batch-heading, .delivery-heading, .version-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .75rem; }
.batch-heading h3, .delivery-heading h4 { margin: 0; overflow-wrap: anywhere; }
.batch-heading h3 { font-size: 1.35rem; }
.batch-description { white-space: pre-wrap; overflow-wrap: anywhere; }
.deliveries { display: grid; gap: .9rem; margin-top: 1rem; }
.delivery { border: 1px solid var(--border); border-radius: .75rem; padding: clamp(.8rem, 2vw, 1rem); min-width: 0; }
.version { border-top: 1px solid var(--border); padding-top: .8rem; margin-top: .8rem; }
.version-tag { background: #e5f3e9; border-radius: .35rem; padding: .3rem .5rem; font-weight: 650; color: #244d3c; font-size: .9rem; }
.art-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr)); margin-top: .8rem; }
.art { border: 1px solid var(--border); border-radius: .55rem; min-width: 0; overflow: hidden; }
.art-link { display: grid; color: var(--green); gap: .35rem; }
.art-link img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: #edf1ec; }
.art-link:focus-visible { outline-offset: -3px; }
.art-link span { padding: .1rem .5rem .55rem; overflow-wrap: anywhere; font-size: .875rem; }
.art button { margin: 0 .5rem .5rem; font-size: .875rem; }
.upload-form, #create-delivery { margin-top: 1rem; }
.upload-form input { font-size: .875rem; }
.upload-form input::file-selector-button { padding: .35rem .5rem; margin-right: .5rem; font: inherit; border: 0; background: #e5f3e9; color: #244d3c; border-radius: .3rem; }
.version-history { margin-top: .9rem; }

@media (min-width: 701px) {
  .dashboard-layout { grid-template-columns: minmax(13rem, 1fr) minmax(0, 2.8fr); }
}

.review-badge { display: inline-block; margin: 0; padding: .3rem .55rem; border-radius: .4rem; font-weight: 680; font-size: .875rem; line-height: 1.3; }
.review-badge.pending { background: #edf1ef; color: #34473e; }
.review-badge.approved { background: #d9f2de; color: #115537; }
.review-badge.changes_requested { background: #f7edda; color: #70471c; }
.review-dialog { width: min(calc(100% - 2rem), 70rem); max-height: calc(100dvh - 2rem); padding: 0; color: inherit; border: 1px solid var(--border); border-radius: 1rem; }
.review-dialog::backdrop { background: #101b16a8; }
.review-dialog-header { position: sticky; top: 0; z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: .7rem; flex-wrap: wrap; background: white; border-bottom: 1px solid var(--border); padding: 1rem 1.25rem; }
.review-dialog-header h2, .review-dialog-header p { margin: 0; overflow-wrap: anywhere; }
.review-dialog-header p { font-size: .875rem; }
.review-dialog-layout { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(17rem, 1fr); gap: 1.25rem; padding: 1.25rem; align-items: start; }
.review-notice { margin: .75rem 1.25rem 0; padding: .6rem .75rem; background: #edf5ef; border-radius: .45rem; }
.review-visual-toolbar, .review-navigation, .decision-actions, .comment-marker { display: flex; align-items: center; flex-wrap: wrap; gap: .6rem; }
.review-visual-toolbar { justify-content: space-between; margin-bottom: .75rem; }
.review-visual-toolbar button, .comment-locate, .comment-marker button { font-size: .875rem; }
.review-navigation span { font-size: .875rem; color: var(--muted); }
.review-image-viewport { max-height: 56dvh; overflow: auto; border: 1px solid var(--border); border-radius: .65rem; background: #edf1ec; padding: 1rem; }
.review-image-canvas { position: relative; width: 100%; }
.review-image-canvas.zoomed { width: 180%; }
.review-image-canvas img { display: block; width: 100%; height: auto; }
.review-art-name { font-size: .875rem; margin: .5rem 0; overflow-wrap: anywhere; }
.art-markers { position: absolute; inset: 0; pointer-events: none; }
.art-pin { position: absolute; transform: translate(-50%, -50%); pointer-events: auto; display: grid; place-items: center; width: 2rem; height: 2rem; min-height: 0; padding: 0; border-radius: 50%; border: 2px solid white; background: #155d40; color: white; font-size: .875rem; box-shadow: 0 0 0 1px #1b342b; }
.draft-pin { pointer-events: none; width: 1.15rem; height: 1.15rem; background: #c9f27e; }
.marker-target { position: absolute; z-index: 2; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; border-radius: 0; background: transparent; cursor: crosshair; }
.marker-target:focus-visible { outline-offset: -3px; }
.review-feedback { min-width: 0; }
.review-feedback h3 { margin-block: 1rem .6rem; }
.review-decision, .feedback-card { border: 1px solid var(--border); border-radius: .55rem; padding: .7rem; }
.review-decision { background: #f7f9f7; }
.review-decision p, .feedback-card p { margin: 0; }
.review-decision .feedback-author { margin-top: .5rem; }
.feedback-author { font-size: .875rem; font-weight: 680; overflow-wrap: anywhere; }
.feedback-text { white-space: pre-wrap; overflow-wrap: anywhere; }
.review-decision .feedback-text, .feedback-card .feedback-text { margin-top: .4rem; }
.version-comments { display: grid; gap: .55rem; padding: 0; margin: 0; list-style: none; }
.comment-locate { margin-top: .45rem; }
.version-comment-form, .changes-form { margin-top: .8rem; }
.comment-marker { font-size: .875rem; color: var(--muted); }
.comment-marker span { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .review-dialog { width: calc(100% - 1rem); max-height: calc(100dvh - 1rem); }
  .review-dialog-header, .review-dialog-layout { padding: .85rem; }
  .review-dialog-layout { grid-template-columns: minmax(0, 1fr); }
  .review-notice { margin-inline: .85rem; }
  .review-image-viewport { max-height: 52dvh; }
}
