:root {
  color-scheme: light;
  font: 16px/1.55 "Segoe UI", system-ui, sans-serif;
  color: #252c25;
  background: #f5f3ec;
  --paper: #fffdf8;
  --green: #1d503d;
  --ink: #252c25;
  --muted: #4f5f55;
  --line: #d8d9ce;
  --control: #7b8b80;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; padding-bottom: 2rem; }
.shell { width: min(100% - 2rem, 1090px); margin-inline: auto; }
.top { border-bottom: 1px solid var(--line); background: var(--paper); }
.top-row { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding-block: .6rem; }
.brand { font-family: Georgia, serif; font-size: clamp(1.25rem, 4vw, 1.65rem); line-height: 1.2; color: #23392c; }
.brand span { white-space: nowrap; }
.top-actions, .actions { display: flex; flex-wrap: wrap; gap: .55rem; align-items: center; }
.top-actions { justify-content: flex-end; }
h1, h2, h3, p { margin: 0; }
h1 { font-family: Georgia, serif; font-weight: 500; font-size: clamp(2rem, 6vw, 3.15rem); line-height: 1.16; }
h2 { font-size: 1.16rem; }
h3 { font-size: 1rem; }
h1:focus { outline: none; }
p { overflow-wrap: anywhere; }
a { color: var(--green); }
button, .button, .quiet {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center;
  padding: .48rem .8rem; border: 1px solid var(--control); border-radius: .44rem;
  background: var(--paper); color: var(--ink); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
button:disabled { opacity: .57; cursor: default; }
button:not(:disabled):hover, .button:hover { border-color: var(--green); background: #edf1e8; }
button.primary, a.primary { color: #fff; background: var(--green); border-color: var(--green); }
button.primary:not(:disabled):hover, a.primary:hover { background: #143a2c; }
button.quiet, a.quiet { background: transparent; border-color: transparent; color: var(--green); padding-inline: .45rem; }
button.quiet:hover, a.quiet:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid #477959; outline-offset: 3px; }
.tabs { display: flex; flex-wrap: wrap; gap: .42rem; margin-top: 1.15rem; padding-bottom: .65rem; border-bottom: 1px solid var(--line); }
.tabs button { border-color: transparent; background: transparent; padding-inline: 1rem; color: var(--green); }
.tabs button[aria-current] { border-color: #a8b6a5; background: #e7eee2; }
#workspace { padding-top: 1.5rem; }
.view-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: .75rem 1rem; margin-bottom: 1.1rem; }
.view-head p { margin-top: .45rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: .7rem; padding: clamp(.85rem, 3vw, 1.35rem); }
.login { max-width: 460px; margin: clamp(1rem, 7vw, 3rem) auto; }
.login form { margin-top: 1rem; }
form, .stack { display: grid; gap: .92rem; }
label { display: grid; gap: .25rem; font-weight: 600; }
input:not([type=checkbox]), textarea {
  display: block; min-width: 0; width: 100%; min-height: 44px; padding: .5rem .6rem;
  border: 1px solid var(--control); border-radius: .35rem; color: var(--ink); background: #fff; font: inherit;
}
textarea { resize: vertical; }
input[type=file] { padding: .55rem; }
label .muted { font-size: .92rem; font-weight: 400; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-weight: 650; margin-bottom: .25rem; }
.muted { color: var(--muted); }
#boot { margin-top: 1.4rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 223px), 1fr)); gap: .95rem; }
.work-card { padding: 0; overflow: hidden; }
.work-card img, .work-card .photo-empty { display: block; width: 100%; height: 9.5rem; object-fit: cover; background: #ebe9df; }
.photo-empty { padding: 1rem; color: var(--muted); }
.card-body { display: grid; gap: .5rem; padding: .8rem; }
.card-body button { justify-self: start; }
.badge { display: inline-block; width: fit-content; font-size: .87rem; color: #374b3d; background: #e9eee4; border-radius: 1rem; padding: .12rem .55rem; }
.editor-form { max-width: 760px; }
.photo-preview { width: min(100%, 400px); max-height: 14.5rem; object-fit: contain; object-position: left center; background: #eeeade; border-radius: .34rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chips label {
  min-height: 44px; display: inline-flex; align-items: center; gap: .45rem; padding: .3rem .65rem;
  border: 1px solid var(--control); border-radius: 1.5rem; font-weight: 500;
}
input[type=checkbox] { width: 1.1rem; height: 1.1rem; accent-color: var(--green); }
details { border-block-start: 1px solid var(--line); padding-top: .55rem; }
summary { min-height: 44px; padding-block: .5rem; cursor: pointer; font-weight: 650; }
details .stack { padding-block: .4rem; }
.category-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .55rem 1rem; }
.category-row h2 { margin-bottom: .2rem; }
.release-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 243px), 1fr)); gap: .9rem; }
.release-steps .panel > * + * { margin-top: .65rem; }
.log { padding-left: 1.35rem; margin: .65rem 0 0; }
.log li { margin-bottom: .6rem; }
.toast {
  position: sticky; bottom: 1rem; margin: 1rem 0 0 auto; width: fit-content; max-width: 100%;
  border: 1px solid #a4bbab; border-radius: .48rem; background: #e5f1e8;
  padding: .65rem .85rem; box-shadow: 0 2px 12px #24332b16;
}
.toast.error { background: #fff0e7; border-color: #a45e47; color: #692d21; }
dialog {
  border: 1px solid var(--line); border-radius: .8rem; background: var(--paper); color: var(--ink);
  width: min(92%, 580px); max-height: 92vh; padding: 1.1rem;
}
dialog::backdrop { background: #13201999; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; }
dialog p { margin: .45rem 0 .8rem; }
dialog img { width: 100%; height: auto; display: block; max-height: 45vh; object-fit: contain; object-position: left center; margin-bottom: .7rem; border: 1px solid var(--line); }
.guide { max-width: 900px; margin-block: 1.6rem; }
.guide section { margin-block: 1.25rem; }
.guide section > * + * { margin-top: .7rem; }
.guide img { display: block; width: min(100%, 720px); height: auto; border: 1px solid var(--line); border-radius: .5rem; }
@media (max-width: 660px) {
  body { padding-bottom: calc(5.3rem + env(safe-area-inset-bottom)); }
  .shell { width: min(100% - 1.4rem, 1090px); }
  .top-row { flex-wrap: wrap; }
  .top-actions { justify-content: flex-start; }
  .tabs {
    position: fixed; z-index: 2; inset: auto 0 0; margin: 0; background: var(--paper);
    border-top: 1px solid var(--line); border-bottom: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .1rem; padding: .3rem .28rem calc(.3rem + env(safe-area-inset-bottom));
  }
  .tabs button { font-size: .87rem; padding-inline: .15rem; }
  #workspace { padding-top: 1.1rem; }
  .toast { bottom: calc(3.9rem + env(safe-area-inset-bottom)); }
  .work-card img, .work-card .photo-empty { height: 11.5rem; }
}

.order-list { display: grid; gap: .55rem; list-style: none; padding: 0; margin: .8rem 0; max-width: 760px; }
.order-row {
  display: grid; grid-template-columns: 44px 56px minmax(0, 1fr) auto;
  gap: .5rem; align-items: center; padding: .5rem; position: relative;
}
.order-row img, .order-empty { width: 56px; height: 50px; object-fit: cover; border-radius: .3rem; background: #e9e8de; }
.order-title { font-weight: 600; overflow-wrap: anywhere; }
.order-grip { touch-action: none; cursor: grab; font-size: 1.4rem; padding: 0; user-select: none; }
.order-row.dragging { opacity: .62; }
.order-row.dragging .order-grip { cursor: grabbing; }
.order-row.drop-before::before, .order-row.drop-after::after {
  content: ""; position: absolute; left: .2rem; right: .2rem; height: 3px; background: var(--green);
}
.order-row.drop-before::before { top: -.35rem; }
.order-row.drop-after::after { bottom: -.35rem; }
@media (max-width: 500px) {
  .order-row { grid-template-columns: 44px 48px minmax(0, 1fr); }
  .order-row img, .order-empty { width: 48px; height: 44px; }
  .order-buttons { grid-column: 2 / -1; }
}

.release-why { border-inline-start: 3px solid #799382; padding-inline-start: .65rem; color: var(--muted); }
.release-changes ul { padding-left: 1.2rem; margin: .3rem 0 0; }
select {
  min-height: 44px; width: min(100%, 520px); font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--control); border-radius: .35rem; padding: .5rem .6rem;
}

.tour-menu { display: grid; gap: .52rem; margin-top: .75rem; }
.tour-choice { display: grid; justify-content: start; text-align: left; gap: .2rem; }
.tour-choice .muted { font-size: .9rem; font-weight: 400; }
#tour-all { margin-top: .5rem; }

.feedback-short { display: none; }
.feedback-layout {
  display: grid; align-items: start; grid-template-columns: minmax(0, .88fr) minmax(0, 1.12fr);
  gap: 1rem;
}
.feedback-form { min-width: 0; }
.feedback-body { white-space: pre-wrap; }
.feedback-actions select { width: auto; max-width: 100%; }
@media (max-width: 700px) {
  .feedback-layout { grid-template-columns: 1fr; }
}
@media (max-width: 660px) {
  .tabs { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .feedback-name { display: none; }
  .feedback-short { display: inline; }
}
@media (max-width: 380px) {
  .tabs button { font-size: .8rem; }
}

.remember-choice { display: flex; align-items: center; min-height: 44px; gap: .55rem; font-weight: 500; }
.remember-choice input { flex: none; }
.device-list { list-style: none; padding: 0; margin: 0; }
.device-list li {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: .5rem; padding-block: .65rem; border-top: 1px solid var(--line);
}
#devices-content { margin-top: .65rem; }
#devices-content p { margin: 0; }

.totp-code { display: block; width: min(100%, 246px); height: auto; }
#totp-confirm details label { margin-top: .6rem; }
#totp-key { font-family: monospace; }
