:root {
    color-scheme: light;
    --ink: #1c1917;
    --muted: #57534e;
    --line: #e7e5e4;
    --paper: #f5f5f4;
    --card: #ffffff;
    --accent: #166534;
    --accent-ink: #ffffff;
    --danger: #991b1b;
    --danger-bg: #fef2f2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--paper);
    color: var(--ink);
    font-family: "Segoe UI", sans-serif;
}

button, input { font: inherit; }

.shell {
    width: min(480px, 100%);
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: var(--card);
    border-bottom: 1px solid var(--line);
}

.top h1 { margin: 0; font-size: 18px; }
.top p { margin: 2px 0 0; color: var(--muted); font-size: 13px; }

.link {
    border: 0;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    min-height: 44px;
}

.panel { padding: 16px; display: grid; gap: 12px; }

.card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 12px;
}

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input[type="email"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="text"] {
    width: 100%;
    min-height: 48px;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0 12px;
    background: #fafaf9;
}

.results, .cart { display: grid; gap: 8px; margin-top: 12px; }

.result, .line {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    width: 100%;
    text-align: left;
    border: 1px solid var(--line);
    background: #fafaf9;
    border-radius: 12px;
    padding: 10px 12px;
    cursor: pointer;
}

.line { cursor: default; }
.result strong, .line strong { display: block; }
.meta { color: var(--muted); font-size: 12px; }

.qty { display: flex; align-items: center; gap: 8px; }
.qty button {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: white;
    cursor: pointer;
}

.methods { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.methods button, .primary, .secondary {
    min-height: 48px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: white;
    cursor: pointer;
}
.methods button[aria-pressed="true"], .primary {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}
.primary { width: 100%; font-weight: 600; }
.primary:disabled { opacity: 0.5; cursor: not-allowed; }

.totals { display: grid; gap: 4px; font-size: 14px; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-size: 18px; font-weight: 700; }

.alert {
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 14px;
}

.receipt {
    white-space: pre;
    font-family: "Cascadia Mono", Consolas, monospace;
    font-size: 12px;
    line-height: 1.35;
    overflow-x: auto;
    margin: 0;
}

.login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}
.login form { width: min(420px, 100%); display: grid; gap: 12px; }
.hint { color: var(--muted); font-size: 13px; }
