:root {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #6e7781;
  --border: #d0d7de;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --danger: #cf222e;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0d1117;
    --text: #e6edf3;
    --muted: #8b949e;
    --border: #30363d;
    --accent: #2f81f7;
    --accent-text: #ffffff;
    --danger: #f85149;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Malgun Gothic", sans-serif;
}

#screen {
  padding: 24px 16px;
  max-width: 960px;
  margin: 0 auto;
}

/* 왼쪽 아래: 버전 + 로그아웃 */
.corner {
  position: fixed;
  left: 12px;
  bottom: 8px;
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

button.link {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* 로그인 화면 */
.login {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 320px;
  margin: 15vh auto 0;
}

.login input,
.login button {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font: inherit;
}

.login input {
  background: var(--bg);
  color: var(--text);
}

.login button {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-text);
  cursor: pointer;
}

.login button:disabled {
  opacity: 0.6;
  cursor: default;
}

a {
  color: var(--accent);
}

.muted {
  color: var(--muted);
  font-weight: normal;
}

.error {
  color: var(--danger);
}

.num {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.menu {
  padding-left: 20px;
  line-height: 2;
}

/* 표: 좁은 화면에서는 표만 옆으로 밀린다 (페이지 전체가 밀리지 않게) */
.table-wrap {
  overflow-x: auto;
  margin-bottom: 16px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th,
td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-weight: 600;
  white-space: nowrap;
}

table.products td:nth-child(2) {
  min-width: 240px;
}

.thumb {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.thumb.big {
  width: 120px;
  height: 120px;
}

.gallery {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* 상품 한 개 */
h1.title {
  font-size: 20px;
  line-height: 1.4;
}

.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
}

.facts dt {
  color: var(--muted);
}

.facts dd {
  margin: 0;
}

.description {
  white-space: pre-wrap;
  line-height: 1.6;
  font-size: 14px;
  padding-bottom: 48px;
}

.login-error {
  min-height: 1.5em;
  margin: 0;
  color: var(--danger);
}
