:root{
  --bg:#EDEEE9;
  --surface:#FFFFFF;
  --surface-2:#F7F7F3;
  --ink:#20241F;
  --ink-muted:#5B6158;
  --accent:#2B5C4B;
  --accent-contrast:#F7F7F3;
  --line:#C9CCC3;
  --danger:#B23A2E;
}
@media (prefers-color-scheme: dark){
  :root{
    --bg:#141713;
    --surface:#1D211C;
    --surface-2:#20241F;
    --ink:#E7E8E2;
    --ink-muted:#A1A69C;
    --accent:#6FAF95;
    --accent-contrast:#10140F;
    --line:#33362F;
    --danger:#E07267;
  }
}

*{ box-sizing:border-box; }
body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:'IBM Plex Sans', system-ui, sans-serif;
  font-size:15px;
  line-height:1.5;
}
a{ color:var(--accent); }

.page{
  max-width:840px;
  margin-inline:auto;
  padding:32px 20px 64px;
  display:flex;
  flex-direction:column;
  gap:28px;
}
.page--narrow{ max-width:380px; padding-top:14vh; }

.toolbar{
  display:flex;
  flex-wrap:wrap;
  gap:16px;
  justify-content:space-between;
  align-items:center;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  padding:20px 24px;
}
.toolbar h1{
  font-family:'Barlow Condensed', sans-serif;
  font-weight:700;
  font-size:26px;
  margin:0 0 4px;
}
.toolbar p{ margin:0; font-size:13px; color:var(--ink-muted); }

.print-form{ display:flex; align-items:flex-end; gap:12px; flex-wrap:wrap; }
.print-field{ display:flex; flex-direction:column; gap:6px; }
.print-field label{
  font-family:'IBM Plex Mono', monospace;
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:var(--ink-muted);
}
.print-field select,
.print-field input{
  font:inherit;
  padding:8px 10px;
  border-radius:7px;
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--ink);
}
.print-field input[type=number]{ width:90px; }
.print-hint{ flex-basis:100%; margin:4px 0 0; font-size:12.5px; color:var(--ink-muted); }

.card{
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:12px;
  padding:24px;
}
.card h2{
  font-family:'Barlow Condensed', sans-serif;
  font-weight:700;
  font-size:20px;
  margin:0 0 16px;
}
.card .error{ color:var(--danger); font-size:13px; margin:-8px 0 16px; }

.label-form{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.label-form--single{ grid-template-columns:1fr; }
.field{ display:flex; flex-direction:column; gap:6px; }
.field--narrow{ grid-column:span 1; }
.field--color{ grid-column:1 / -1; }
.field--actions{ grid-column:1 / -1; flex-direction:row; align-items:center; gap:12px; }
.field label, .field-label{
  font-size:12px;
  font-weight:600;
  color:var(--ink-muted);
  text-transform:uppercase;
  letter-spacing:.03em;
}
.field input[type=text],
.field input[type=password]{
  font:inherit;
  padding:10px 12px;
  border-radius:8px;
  border:1px solid var(--line);
  background:var(--surface-2);
  color:var(--ink);
}
.field input:focus{ outline:2px solid var(--accent); outline-offset:1px; }

.swatches{ display:flex; gap:10px; flex-wrap:wrap; }
.swatch{ position:relative; cursor:pointer; }
.swatch input{ position:absolute; opacity:0; width:1px; height:1px; }
.swatch span{
  display:block;
  width:28px;
  height:28px;
  border-radius:6px;
  background:var(--swatch-color);
  border:2px solid transparent;
}
.swatch input:checked + span{ border-color:var(--ink); }
.swatch input:focus-visible + span{ outline:2px solid var(--accent); outline-offset:2px; }

.btn-primary{
  font:inherit;
  font-weight:600;
  background:var(--accent);
  color:var(--accent-contrast);
  border:none;
  padding:10px 18px;
  border-radius:8px;
  cursor:pointer;
}
.btn-primary:hover{ filter:brightness(1.08); }
.btn-primary:focus-visible{ outline:2px solid var(--accent); outline-offset:2px; }

.btn-ghost{
  font:inherit;
  font-size:13px;
  font-weight:500;
  background:none;
  border:1px solid var(--line);
  color:var(--ink-muted);
  padding:8px 14px;
  border-radius:8px;
  cursor:pointer;
  text-decoration:none;
  display:inline-block;
}
.btn-ghost:hover{ color:var(--ink); border-color:var(--ink-muted); }

.btn-danger{
  font:inherit;
  font-size:13px;
  background:none;
  border:1px solid var(--line);
  color:var(--danger);
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
}
.btn-danger:hover{ background:var(--danger); color:#fff; border-color:var(--danger); }

.list{ display:flex; flex-direction:column; gap:10px; }
.empty{ color:var(--ink-muted); font-size:14px; }

.row-card{
  display:flex;
  align-items:center;
  gap:14px;
  background:var(--surface);
  border:1px solid var(--line);
  border-radius:10px;
  padding:12px 16px;
}
.row-card .tag{ width:14px; height:36px; border-radius:3px; flex:0 0 auto; }
.row-card .text{ flex:1 1 auto; min-width:0; }
.row-card .title{
  font-family:'Barlow Condensed', sans-serif;
  font-weight:700;
  font-size:17px;
  text-transform:uppercase;
  letter-spacing:.02em;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.row-card .subtitle{
  font-size:12.5px;
  color:var(--ink-muted);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.row-card .meta{
  font-family:'IBM Plex Mono', monospace;
  font-size:11.5px;
  color:var(--ink-muted);
  text-transform:uppercase;
  letter-spacing:.03em;
  flex:0 0 auto;
  max-width:120px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.row-actions{ display:flex; align-items:center; gap:6px; flex:0 0 auto; }
.row-actions form{ display:inline; }
.row-actions button{
  font:inherit;
  background:var(--surface-2);
  border:1px solid var(--line);
  color:var(--ink-muted);
  width:30px;
  height:30px;
  border-radius:7px;
  cursor:pointer;
}
.row-actions button:hover:not(:disabled){ color:var(--ink); }
.row-actions button:disabled{ opacity:.35; cursor:default; }

@media (max-width:560px){
  .label-form{ grid-template-columns:1fr; }
  .row-card{ flex-wrap:wrap; }
  .row-actions{ width:100%; justify-content:flex-end; }
}
