:root {
  --primary: #1f5c99;
  --primary-dark: #14406b;
  --danger: #c0392b;
  --border: #d8dee5;
  --bg: #f4f6f8;
  --text: #1c2733;
  --muted: #6b7785;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, "Segoe UI", "Microsoft JhengHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding: 24px 20px 40px;
  display: flex;
  flex-direction: column;
}

header.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

header.app-header h1 {
  font-size: 18px;
  margin: 0;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}

.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 6px;
  padding: 12px 20px;
  font-size: 15px;
  cursor: pointer;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  transition: background 0.15s;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:disabled {
  background: #a9b6c2;
  cursor: not-allowed;
}

.btn-secondary {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-block {
  width: 100%;
}

.field {
  margin-bottom: 14px;
}

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

.field .field-row {
  display: flex;
  gap: 8px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}

.field input:invalid,
.field input.error {
  border-color: var(--danger);
}

.field .char-count {
  font-size: 11px;
  color: var(--muted);
  text-align: right;
}

.item-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.item-row .field {
  margin-bottom: 0;
  flex: 1;
}

.item-row .qty-field {
  flex: 0 0 90px;
}

.item-remove {
  flex: 0 0 auto;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--danger);
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.record-button {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  margin: 32px auto;
  display: block;
  user-select: none;
  touch-action: none;
}

.record-button.recording {
  background: var(--danger);
}

.record-status {
  text-align: center;
  color: var(--muted);
  min-height: 20px;
}

.error-banner {
  background: #fdecea;
  border: 1px solid var(--danger);
  color: var(--danger);
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
  font-size: 14px;
}

.order-structure-hint {
  background: #eef4fa;
  border-radius: 6px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.7;
}

pre.csv-preview {
  background: #f8f9fa;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

a.link {
  color: var(--primary);
}
