/* ── Printer Settings Page ── */
.printer-page {
  --pr-accent: #475569;
  --pr-accent-soft: #f1f5f9;
  --pr-ready: #16a34a;
  min-height: 100%;
  padding-bottom: var(--space-lg);
}

.pr-page-header {
  margin-bottom: var(--space-md);
}

.pr-title-wrap {
  border-left: 4px solid var(--pr-accent);
  padding-left: var(--space-sm);
}

.pr-title-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pr-subtitle {
  margin: 0;
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-weight: 500;
}

/* Status banner */
.pr-status-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-lg);
  background: var(--pr-accent-soft);
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-lg);
  flex-wrap: wrap;
}

.pr-status-banner-left {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.pr-status-banner-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--pr-accent);
  flex-shrink: 0;
}

.pr-status-banner-icon svg {
  width: 24px;
  height: 24px;
}

.pr-status-banner-label {
  display: block;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: 2px;
}

.pr-status-banner-type {
  font-family: var(--font-bn);
  font-size: var(--text-md);
  font-weight: 700;
  color: var(--color-text-primary);
}

.pr-status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  font-weight: 600;
  background: #fff;
  color: var(--pr-accent);
  border: 1px solid #e2e8f0;
}

.pr-status-badge.is-ready {
  background: #f0fdf4;
  color: var(--pr-ready);
  border-color: #bbf7d0;
}

/* Settings grid */
.pr-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
}

.pr-card {
  padding: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.pr-card-title {
  font-family: var(--font-bn);
  font-size: var(--text-md);
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--color-text-primary);
}

.pr-card-desc {
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-md);
}

/* Printer type tiles */
.pr-tile-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-sm);
}

.pr-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: var(--space-md) var(--space-sm);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
}

.pr-tile:hover {
  border-color: #94a3b8;
  background: var(--pr-accent-soft);
}

.pr-tile.is-selected {
  border-color: var(--pr-accent);
  background: var(--pr-accent-soft);
  box-shadow: 0 0 0 1px var(--pr-accent);
}

.pr-tile-input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.pr-tile-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pr-accent);
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
}

.pr-tile-check svg {
  width: 12px;
  height: 12px;
}

.pr-tile.is-selected .pr-tile-check {
  display: flex;
}

.pr-tile-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--pr-accent);
}

.pr-tile-icon svg {
  width: 28px;
  height: 28px;
}

.pr-tile-label {
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text-primary);
}

.pr-tile-hint {
  font-family: var(--font-bn);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* Memo preview mockup */
.pr-memo-preview {
  max-width: 220px;
  margin: 0 auto var(--space-md);
  padding: var(--space-md);
  background: #fff;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-sm);
  font-family: var(--font-bn);
  font-size: 11px;
  color: var(--color-text-primary);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
}

.pr-memo-shop {
  font-weight: 700;
  font-size: 12px;
  text-align: center;
  margin-bottom: 2px;
}

.pr-memo-line {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 10px;
  margin-bottom: 8px;
}

.pr-memo-divider {
  border-top: 1px dashed #cbd5e1;
  margin: 6px 0;
}

.pr-memo-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 3px;
}

.pr-memo-total {
  font-weight: 700;
}

.pr-memo-thanks {
  text-align: center;
  margin-top: 8px;
  font-size: 10px;
  color: var(--color-text-muted);
}

.pr-memo-btn {
  display: flex;
  width: 100%;
  justify-content: center;
}

/* Test print card */
.pr-test-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--pr-accent-soft);
  border-radius: var(--radius-md);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
}

.pr-test-type-label {
  color: var(--color-text-muted);
}

.pr-test-type-value {
  font-weight: 700;
  color: var(--color-text-primary);
}

.pr-test-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  justify-content: center;
}

.pr-test-btn svg {
  width: 18px;
  height: 18px;
}

/* Quick links */
.pr-quick-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pr-quick-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text-primary);
  text-decoration: none;
  background: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.pr-quick-link svg {
  width: 18px;
  height: 18px;
  color: var(--pr-accent);
  flex-shrink: 0;
}

.pr-quick-link:hover {
  background: var(--pr-accent-soft);
  border-color: #94a3b8;
}

/* Print area */
.pr-test-print-area {
  display: none;
}

@media print {
  body * { visibility: hidden; }
  .pr-test-print-area, .pr-test-print-area * { visibility: visible; }
  .pr-test-print-area {
    display: block;
    position: absolute;
    left: 0;
    top: 0;
    width: 80mm;
    padding: 8px;
    font-family: monospace;
    font-size: 12px;
    white-space: pre-wrap;
  }
}

/* Toast */
.pr-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  z-index: 300;
  padding: 12px 20px;
  background: #111827;
  color: #fff;
  border-radius: var(--radius-md);
  font-family: var(--font-bn);
  font-size: var(--text-sm);
  transition: transform 0.3s ease;
}

.pr-toast.is-visible { transform: translateX(-50%) translateY(0); }

/* Responsive */
@media (max-width: 900px) {
  .pr-settings-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .pr-tile-group {
    grid-template-columns: 1fr;
  }

  .pr-status-banner {
    flex-direction: column;
    align-items: flex-start;
  }
}
