/*
 * Panduan BukuKasir. Warna, font, dan bentuk mengikuti STYLE_GUIDE.md aplikasi
 * supaya pembaca langsung mengenali tampilan yang sama dengan layar kasirnya.
 * Teks sekunder memakai slate-600 (slate-500 di atas slate-100 gagal WCAG AA).
 */
:root {
  --teal-50: #f0fdfa;
  --teal-100: #ccfbf1;
  --teal-700: #0f766e;
  --teal-800: #115e59;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-900: #0f172a;
  --amber-50: #fffbeb;
  --amber-200: #fde68a;
  --amber-800: #92400e;
  --radius-card: 16px;
  --radius-control: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--slate-100);
  color: var(--slate-900);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
}

a {
  color: var(--teal-700);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--teal-800);
}

:focus-visible {
  outline: 3px solid var(--teal-700);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 50;
  padding: 10px 14px;
  background: var(--slate-900);
  color: #fff;
  border-radius: var(--radius-control);
}

.skip:focus {
  top: 12px;
  color: #fff;
}

/* Header: compact so the phone screen stays mostly content. */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(241, 245, 249, 0.96);
  border-bottom: 1px solid var(--slate-200);
}

.site-header .inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--slate-900);
  text-decoration: none;
  font-weight: 800;
}

.brand img {
  width: 32px;
  height: 32px;
}

.brand small {
  display: block;
  font-weight: 600;
  font-size: 0.75rem;
  color: var(--slate-600);
  line-height: 1.2;
}

.brand span {
  line-height: 1.2;
}

.open-app {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: var(--radius-control);
  background: var(--teal-700);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  white-space: nowrap;
}

.open-app:hover {
  background: var(--teal-800);
  color: #fff;
}

/* Layout: one column on phones, sidebar from 960px where both fit. */
.layout {
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px 16px 48px;
}

.nav-panel {
  margin-bottom: 16px;
}

.menu {
  background: #fff;
  border-radius: var(--radius-card);
  border: 1px solid var(--slate-200);
}

.menu summary {
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 700;
  border-radius: var(--radius-card);
}

.menu summary::-webkit-details-marker {
  display: none;
}

.menu summary .current {
  font-weight: 500;
  color: var(--slate-600);
  font-size: 0.9rem;
  margin-left: auto;
  margin-right: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.menu summary .chev {
  flex: none;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--slate-700);
  border-bottom: 2px solid var(--slate-700);
  transform: rotate(45deg);
  margin-top: -4px;
}

.menu[open] summary .chev {
  transform: rotate(-135deg);
  margin-top: 4px;
}

.nav-list {
  list-style: none;
  margin: 0;
  padding: 4px 8px 10px;
}

.nav-group {
  margin: 10px 8px 4px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--slate-600);
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: var(--radius-control);
  color: var(--slate-700);
  font-weight: 600;
  text-decoration: none;
}

.nav-list a:hover {
  background: var(--slate-100);
  color: var(--slate-900);
}

.nav-list a[aria-current="page"] {
  background: var(--teal-50);
  color: var(--teal-800);
}

/* Content card */
main {
  min-width: 0;
}

.page {
  background: #fff;
  border-radius: var(--radius-card);
  padding: 22px 18px 28px;
}

.page > :first-child {
  margin-top: 0;
}

h1 {
  font-size: 1.6rem;
  line-height: 1.25;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.lead {
  font-size: 1.05rem;
  color: var(--slate-700);
  margin: 0 0 20px;
}

h2 {
  font-size: 1.2rem;
  line-height: 1.3;
  font-weight: 800;
  margin: 34px 0 10px;
  padding-top: 18px;
  border-top: 1px solid var(--slate-200);
}

h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 22px 0 6px;
}

p,
ul,
ol {
  margin: 0 0 12px;
}

ul,
ol {
  padding-left: 1.3rem;
}

li {
  margin-bottom: 6px;
}

li::marker {
  color: var(--slate-600);
  font-weight: 700;
}

/* Steps: numbered list with the number in the brand teal, the one sequence
   readers follow with the phone in their other hand. */
ol.steps {
  list-style: none;
  counter-reset: step;
  padding-left: 0;
}

ol.steps > li {
  counter-increment: step;
  position: relative;
  padding-left: 40px;
  margin-bottom: 12px;
  min-height: 28px;
}

ol.steps > li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 1px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-700);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Identity motif: an on-screen label drawn like the app's own button, so the
   reader matches the text to what they tap. */
.ui {
  display: inline-block;
  padding: 0 7px;
  border: 1px solid var(--slate-300);
  border-radius: 7px;
  background: #fff;
  box-shadow: 0 1px 0 var(--slate-300);
  font-weight: 650;
  font-size: 0.92em;
  line-height: 1.6;
  color: var(--slate-900);
  white-space: normal;
}

.ui.primary {
  background: var(--teal-700);
  border-color: var(--teal-800);
  box-shadow: 0 1px 0 var(--teal-800);
  color: #fff;
}

.path {
  font-weight: 700;
  color: var(--slate-900);
}

/* Callouts: tinted block plus a written label, never color alone. */
.note,
.warn {
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
}

.note {
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  color: var(--teal-800);
}

.warn {
  background: var(--amber-50);
  border: 1px solid var(--amber-200);
  color: var(--amber-800);
}

.note p:last-child,
.warn p:last-child,
.note ul:last-child,
.warn ul:last-child {
  margin-bottom: 0;
}

.note strong,
.warn strong {
  display: block;
  margin-bottom: 2px;
}

/* Tables scroll inside their own box so the page never scrolls sideways. */
.table-wrap {
  overflow-x: auto;
  margin: 12px 0 16px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 520px;
  font-size: 0.92rem;
}

th,
td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid var(--slate-200);
  vertical-align: top;
}

th {
  background: var(--slate-100);
  font-weight: 700;
}

tr:last-child td {
  border-bottom: 0;
}

td.yes {
  color: var(--teal-800);
  font-weight: 700;
}

td.no {
  color: var(--slate-600);
}

dl.errors {
  margin: 12px 0 0;
}

dl.errors dt {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88rem;
  background: var(--slate-100);
  color: var(--slate-900);
  border-radius: 8px;
  padding: 8px 10px;
  margin-top: 16px;
  overflow-wrap: anywhere;
}

dl.errors dd {
  margin: 6px 0 0 2px;
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
}

code {
  background: var(--slate-100);
  border-radius: 5px;
  padding: 1px 5px;
  overflow-wrap: anywhere;
}

/* Home: the guide list reads as a table of contents, not a card grid. */
.guide-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  border-top: 1px solid var(--slate-200);
}

.guide-list li {
  margin: 0;
  border-bottom: 1px solid var(--slate-200);
}

.guide-list a {
  display: block;
  padding: 12px 4px;
  min-height: 44px;
  text-decoration: none;
  color: var(--slate-900);
}

.guide-list a strong {
  display: block;
  color: var(--teal-700);
  font-size: 1.02rem;
}

.guide-list a span {
  color: var(--slate-600);
  font-size: 0.93rem;
}

.guide-list a:hover strong {
  text-decoration: underline;
}

.start-path {
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: var(--radius-card);
  padding: 16px 16px 6px;
  margin: 18px 0 6px;
}

.start-path h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 0;
  color: var(--teal-800);
}

/* Previous / next at the end of each page */
.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--slate-200);
}

.pager a {
  flex: 1 1 200px;
  display: block;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid var(--slate-300);
  border-radius: 12px;
  text-decoration: none;
  color: var(--slate-900);
  font-weight: 700;
}

.pager a small {
  display: block;
  color: var(--slate-600);
  font-weight: 500;
}

.pager a.next {
  text-align: right;
}

.pager a:hover {
  border-color: var(--teal-700);
}

.site-footer {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px 32px;
  color: var(--slate-600);
  font-size: 0.88rem;
}

/* Tablet: wider card padding, still one column. */
@media (min-width: 640px) {
  .layout {
    padding: 20px 24px 56px;
  }

  .page {
    padding: 30px 34px 36px;
  }

  h1 {
    font-size: 1.85rem;
  }

  .site-header .inner,
  .site-footer {
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* Desktop: the menu becomes a sticky sidebar, always open. */
@media (min-width: 960px) {
  .layout {
    display: grid;
    grid-template-columns: 250px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }

  .nav-panel {
    position: sticky;
    top: 82px;
    margin-bottom: 0;
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
  }

  .menu {
    background: transparent;
    border: 0;
  }

  .menu summary {
    display: none;
  }

  .nav-list {
    padding: 0;
  }

  .page {
    padding: 36px 44px 40px;
    max-width: 780px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nav-list a,
  .pager a,
  .open-app {
    transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  }
}
