/* man.tools — "kotak perkakas" design
   Tema: data-theme="light" | "dark" di <html>, diatur oleh assets/theme.js */

@font-face { font-family: "Archivo"; font-weight: 400; font-display: swap; src: url("fonts/archivo-400.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 500; font-display: swap; src: url("fonts/archivo-500.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 700; font-display: swap; src: url("fonts/archivo-700.woff2") format("woff2"); }
@font-face { font-family: "Archivo"; font-weight: 900; font-display: swap; src: url("fonts/archivo-900.woff2") format("woff2"); }
@font-face { font-family: "Archivo Narrow"; font-weight: 700; font-display: swap; src: url("fonts/archivo-narrow-700.woff2") format("woff2"); }

:root {
  /* brand: kuning perkakas, sama di kedua tema */
  --brand: #ffc400;
  --brand-hover: #ffd23f;
  --brand-ink: #141413;
  --tape: #0b0b0a;        /* pita label Dymo */
  --tape-ink: #f5f5f2;

  /* tema terang (default) */
  --bg: #eeece6;
  --dot: #d6d3ca;
  --surface: #ffffff;
  --surface-2: #f3f1ec;
  --text: #161615;
  --muted: #5c5850;
  --border: #d8d4ca;
  --accent: #161615;       /* aksen untuk teks/garis: tinta hitam di terang */
  --accent-ink: #ffc400;   /* teks di atas --accent */
  --accent-soft: #fff1bf;
  --focus: #161615;
  --danger: #b42318;
  --warn: #8a4b00;
  --ok: #067647;
  --radius: 6px;
  --shadow: 0 1px 0 rgba(0, 0, 0, .04);
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-label: "Archivo Narrow", "Archivo", system-ui, sans-serif;
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #161615;
  --dot: #2a2926;
  --surface: #1f1f1d;
  --surface-2: #2a2927;
  --text: #f2efe8;
  --muted: #a8a49b;
  --border: #34332f;
  --accent: #ffc400;
  --accent-ink: #141413;
  --accent-soft: #3a3110;
  --focus: #ffc400;
  --danger: #f97066;
  --warn: #fdb022;
  --ok: #47cd89;
  --shadow: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  background-color: var(--bg);
  background-image: radial-gradient(var(--dot) 1.4px, transparent 1.5px);
  background-size: 22px 22px;
  color: var(--text);
  line-height: 1.5;
  font-size: 16px;
}
a { color: var(--text); text-decoration-color: var(--brand); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.wrap { max-width: 600px; margin: 0 auto; padding: 20px 16px 48px; }

/* top bar on tool pages */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.topbar > div:not(.tb-end) { flex: 1; min-width: 0; }
.back, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; border-radius: 4px;
  background: var(--surface); border: 2px solid var(--text);
  color: var(--text); text-decoration: none; font-size: 22px; font-weight: 700; cursor: pointer; padding: 0;
}
.back:hover, .icon-btn:hover { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.topbar h1 { font-size: 24px; font-weight: 900; letter-spacing: -0.02em; line-height: 1.15; margin: 0; }
.topbar .sub { font-size: 13px; color: var(--muted); }
.icon-btn svg, .back svg { width: 20px; height: 20px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.card h2 { font-size: 15px; font-weight: 800; margin: 0 0 10px; }

/* Dymo label */
.dymo {
  display: inline-block; background: var(--tape); color: var(--tape-ink);
  font-family: var(--font-label); font-weight: 700; font-size: 13px; letter-spacing: .16em; text-transform: uppercase;
  padding: 5px 12px 4px; border-radius: 3px; transform: rotate(-1.2deg);
  box-shadow: 0 2px 0 #000, inset 0 1px 0 rgba(255, 255, 255, .1); text-shadow: 0 1px 0 rgba(255, 255, 255, .18);
}

label { display: block; font-size: 13px; font-weight: 500; color: var(--muted); margin: 10px 0 4px; }
label:first-child { margin-top: 0; }
input[type=text], input[type=number], input[type=date], input[type=password], input[type=datetime-local],
input[type=search], select, textarea {
  width: 100%; font: inherit; color: var(--text);
  background: var(--surface-2); border: 2px solid var(--border);
  border-radius: 4px; padding: 9px 12px; min-height: 44px;
}
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
textarea { resize: vertical; min-height: 110px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--focus); }
button:focus-visible, a:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
input[type=range] { width: 100%; accent-color: var(--brand); }
input[type=checkbox] { accent-color: var(--brand); width: 18px; height: 18px; }

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 800; cursor: pointer;
  min-height: 46px; padding: 10px 18px; border-radius: 4px;
  border: 2px solid var(--brand); background: var(--brand); color: var(--brand-ink);
  text-decoration: none;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.ghost { background: transparent; border-color: var(--text); color: var(--text); }
.btn.ghost:hover { background: var(--text); color: var(--bg); }
.btn.block { width: 100%; }
.btn:disabled, .btn:disabled:hover { background: var(--surface-2); border-color: var(--border); color: var(--muted); cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.actions .btn { flex: 1; }

/* segmented tabs */
.tabs { display: flex; gap: 4px; background: var(--surface); border: 2px solid var(--text); padding: 3px; border-radius: 6px; margin-bottom: 14px; }
.tabs button {
  flex: 1; font: inherit; font-size: 14px; font-weight: 700; min-height: 38px;
  border: 0; border-radius: 3px; background: transparent; color: var(--muted); cursor: pointer;
}
.tabs button:hover { color: var(--text); }
.tabs button[aria-selected=true] { background: var(--brand); color: var(--brand-ink); }
[hidden] { display: none !important; }

.result { font-size: 30px; font-weight: 900; line-height: 1.15; letter-spacing: -0.02em; }
.muted { color: var(--muted); font-size: 14px; }
.small { font-size: 13px; }
.pill {
  display: inline-block; font-size: 12px; font-weight: 700;
  padding: 2px 8px; border-radius: 3px; background: var(--accent-soft); color: var(--accent);
}
.list { list-style: none; padding: 0; margin: 0; }
.list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.list li:last-child { border-bottom: 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--tape); color: var(--tape-ink); padding: 10px 16px; border-radius: 4px; border-left: 4px solid var(--brand);
  font-size: 14px; font-weight: 500; opacity: 0; transition: opacity .2s; pointer-events: none; z-index: 10;
}
.toast.show { opacity: 1; }

.foot { text-align: center; color: var(--muted); font-size: 12px; margin-top: 28px; }
.ic { display: inline-block; vertical-align: -3px; }
:root[data-theme="dark"] .dymo { box-shadow: 0 0 0 1px #3d3c38, 0 2px 0 #000; }
.card:empty { display: none; }
