:root {
  color-scheme: light;
  --ink: #142c36;
  --muted: #526870;
  --paper: #f2f5f6;
  --line: #d9e2e5;
  --accent: #b9f04b;
  --error: #a02030;
  --radius: 18px;
  font:
    16px/1.5 "Segoe UI",
    system-ui,
    sans-serif;
  color: var(--ink);
  background: var(--paper);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a,
input,
select,
textarea {
  touch-action: manipulation;
}
button,
.button {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  padding: 0.8rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  font-weight: 600;
}
button:hover,
.button:hover {
  border-color: var(--ink);
}
button:disabled {
  opacity: 0.55;
  cursor: wait;
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
}
.danger {
  color: var(--error);
}
a {
  color: inherit;
}
h1 {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.04em;
  margin: 0 0 1rem;
}
h2 {
  font-size: 1.3rem;
  line-height: 1.3;
  margin: 0 0 1rem;
}
p {
  margin: 0.6rem 0 1rem;
}
.top {
  height: 96px;
  padding: 20px max(5vw, 20px);
  background: var(--ink);
  color: white;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.brand {
  font-size: 1.6rem;
  font-weight: 750;
  letter-spacing: -0.05em;
  text-decoration: none;
}
.brand span {
  color: var(--accent);
}
.brand small {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.17em;
  font-weight: 500;
  color: #c7d5da;
}
.top-back {
  background: #ffffff14;
  border-color: #ffffff33;
  color: white;
  padding: 0.6rem 0.9rem;
}
#connection {
  font-size: 0.85rem;
  max-width: 45%;
  text-align: right;
}
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 24px 130px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 18px;
}
.muted,
.meta {
  color: var(--muted);
}
.meta {
  font-size: 0.875rem;
  overflow-wrap: anywhere;
}
.row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}
.backbar {
  margin-bottom: 18px;
}
.field-hints {
  display: none;
}
.field-suggest {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}
.field-suggest button {
  padding: 0.35rem 0.65rem;
  font-size: 0.85rem;
  background: #edf2f3;
}
.reuse-hint {
  margin-top: 8px;
  background: #f8fbfc;
}
.ai-mode {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.between {
  justify-content: space-between;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}
input,
select,
textarea {
  width: 100%;
  border: 1px solid #aabcc2;
  border-radius: 9px;
  padding: 0.75rem;
  background: white;
  color: var(--ink);
  margin-top: 6px;
}
textarea {
  min-height: 100px;
  resize: vertical;
}
label.full,
.full {
  grid-column: 1/-1;
}
input[type="checkbox"] {
  width: auto;
  margin: 0 10px 0 0;
}
.check {
  display: flex;
  align-items: center;
  min-height: 48px;
}
.scan-hero {
  background: var(--ink);
  color: white;
  padding: 32px;
  border-radius: var(--radius);
  margin: 22px 0;
}
.scan-hero h2 {
  font-size: 1.65rem;
}
.scan-hero .muted {
  color: #c7d5da;
}
.big {
  font-size: 1.15rem;
  padding: 20px 28px;
}
.badge {
  border-radius: 30px;
  padding: 5px 12px;
  background: #edf2f3;
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 650;
}
.badge.good {
  background: #e5f6c5;
}
.list {
  display: grid;
  gap: 12px;
}
.item {
  display: flex;
  text-align: left;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  width: 100%;
  padding: 20px;
  border-radius: 15px;
}
.draft-row {
  background: white;
}
.draft-row a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 1;
  gap: 15px;
  text-decoration: none;
}
.item strong {
  display: block;
  font-size: 1.05rem;
}
.item .meta {
  margin-top: 4px;
}
.photos {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin: 15px 0;
}
.photos figure {
  margin: 0;
  width: 140px;
}
.photos img {
  width: 140px;
  height: 130px;
  object-fit: cover;
  border-radius: 12px;
  background: var(--paper);
}
.photos figcaption {
  font-size: 0.8rem;
}
.photos button {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
}
video {
  max-width: 100%;
  max-height: 360px;
  border-radius: 12px;
  background: #111;
}
.login {
  max-width: 460px;
  margin: 40px auto;
}
.login label {
  margin: 18px 0;
}
.empty {
  padding: 35px 15px;
  text-align: center;
  color: var(--muted);
}
nav {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  max-width: calc(100% - 24px);
  background: var(--ink);
  padding: 8px;
  border-radius: 20px;
  z-index: 5;
  box-shadow: 0 8px 35px #142c3633;
}
nav a {
  padding: 14px 28px;
  color: white;
  text-decoration: none;
  font-weight: 650;
  border-radius: 13px;
  white-space: nowrap;
}
nav a.active {
  background: #36515c;
}
nav .scan-tab {
  background: var(--accent);
  color: var(--ink);
}
#notice {
  position: fixed;
  right: 20px;
  top: 108px;
  max-width: min(450px, calc(100% - 40px));
  padding: 0;
  z-index: 10;
}
#notice:not(:empty) {
  background: var(--ink);
  color: white;
  padding: 16px 22px;
  border-radius: 14px;
  box-shadow: 0 5px 20px #142c3633;
}
.warning {
  background: #fff5d7;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e3c875;
}
.qr {
  display: block;
  width: 230px;
  height: 230px;
  max-width: 100%;
  margin: 18px auto;
}
.print-label {
  text-align: center;
}
.print-label.qr-only {
  width: fit-content;
  max-width: 100%;
  margin-inline: auto;
}
.print-label .meta {
  word-break: break-all;
}
.local-qr svg {
  display: block;
  width: 230px;
  height: 230px;
  max-width: 100%;
}
details {
  border-top: 1px solid var(--line);
  padding-top: 15px;
  margin-top: 20px;
}
summary {
  cursor: pointer;
  font-weight: 650;
}
pre {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font: 0.85rem/1.5 monospace;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid #2875bd;
  outline-offset: 3px;
}
[hidden] {
  display: none !important;
}
@media (max-width: 650px) {
  .top {
    height: 82px;
    gap: 8px;
  }
  .brand {
    font-size: 1.3rem;
  }
  .top-back {
    padding: 0.5rem 0.75rem;
  }
  main {
    padding: 26px 16px 125px;
  }
  .grid,
  .fields {
    grid-template-columns: 1fr;
  }
  .card {
    padding: 20px;
  }
  .scan-hero {
    padding: 24px;
  }
  nav {
    bottom: max(10px, env(safe-area-inset-bottom));
  }
  nav a {
    padding: 12px 17px;
  }
  .item {
    padding: 17px;
  }
  .row button {
    flex-grow: 1;
  }
}
@media print {
  @page {
    margin: 4mm;
  }
  body {
    background: white;
  }
  .top,
  nav,
  #notice,
  .print-actions,
  main > *:not(.print-label) {
    display: none !important;
  }
  main {
    padding: 0;
    max-width: none;
  }
  .print-label {
    border: 0;
    box-shadow: none;
    width: auto;
    margin: 0 auto;
    padding: 0;
  }
  .print-label button {
    display: none;
  }
  .print-label.qr-only .qr,
  .print-label.qr-only svg {
    display: block;
    width: 45mm;
    height: 45mm;
    margin: 0 auto;
  }
  a[href]:after {
    content: none;
  }
}
