:root {
  --bg: #ffffff;
  --bg-2: #f6f5f3;
  --surface: #ffffff;
  --text: #000000;
  --muted: #5e5e5e;
  --border: #e0e0e0;
  --border-strong: #000000;
  --focus: #000000;
  --surface-primary: var(--surface);
  --surface-secondary: var(--bg-2);
  --border-light: rgba(0, 0, 0, 0.08);
  --accent-primary: var(--surface);
  --accent-secondary: var(--surface);
  --shadow-card: none;
  --sidebar-width: 260px;
  --sidebar-width-collapsed: 70px;
  --header-height: 60px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #FAFAFA;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, "Noto Sans JP", sans-serif;
  display: flex;
  height: 100vh;
  overflow: hidden;
}

h1, h2, h3, .logo-text {
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, "Noto Sans JP", sans-serif;
  letter-spacing: 0;
}

h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.5rem; font-weight: 700; }
h3 { font-size: 1.15rem; font-weight: 700; }

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: var(--surface-primary);
  border-right: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  padding: 32px 16px;
  flex-shrink: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  white-space: nowrap;
}

.sidebar.collapsed {
  width: var(--sidebar-width-collapsed);
}

.logo-area {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 32px;
  padding: 0 16px;
  height: 48px;
}

.logo-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  transition: opacity 0.2s;
}

.sidebar.collapsed .logo-text {
  display: none;
}

.toggle-btn {
  background: var(--surface-secondary);
  border: 1px solid var(--border-light);
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
  width: 36px;
  height: 36px;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.toggle-btn:hover {
  border-color: var(--muted);
  background: var(--bg-2);
}

.toggle-btn:active {
  border: 2px solid var(--border-strong);
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 16px 16px;
  color: var(--muted);
  text-decoration: none;
  border-radius: 2px;
  border: 1px solid var(--border-light);
  transition: all 0.2s ease;
}

.nav-item:hover {
  background: var(--bg-2);
  color: var(--text);
  border-color: var(--muted);
}

.nav-item.active {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: none;
  border: 2px solid var(--border-strong);
  font-weight: 600;
}

.nav-icon {
  font-size: 1.2rem;
  min-width: 28px;
  text-align: center;
  display: none;
}

.nav-icon .icon-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-text {
  margin-left: 16px;
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.sidebar.collapsed .nav-text { display: none; }
.sidebar.collapsed .nav-item { justify-content: center; padding: 16px 0; }
.sidebar.collapsed .nav-icon { display: block; }

.nav-item.logout {
  margin-top: auto;
  border-top: 1px solid var(--border-light);
  padding-top: 32px;
  color: var(--text);
}

/* --- Main Layout --- */
.main-wrapper {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

.main-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 32px;
  -webkit-overflow-scrolling: touch;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: var(--header-height);
  background: var(--surface-primary);
  border-bottom: 1px solid var(--border-light);
  flex-shrink: 0;
  gap: 16px;
}

.app-header-left,
.app-header-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-title {
  margin-left: 16px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.8px;
}

.header-credits {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 6px 10px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: var(--surface-secondary);
}

.header-credits-label {
  color: var(--muted);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}

.header-credits-value {
  font-weight: 700;
  color: var(--text);
  font-size: 0.95rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: -260px;
    top: 0;
    bottom: 0;
    width: var(--sidebar-width);
    box-shadow: none;
  }

  .sidebar.mobile-open {
    left: 0;
  }

  .app-header {
    padding: 0 16px;
  }

  .app-title {
    margin-left: 12px;
  }

  .main-content {
    padding: 16px;
  }

  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.35);
    z-index: 999;
  }

  .sidebar-overlay.active { display: block; }
}

@media (min-width: 769px) {
  .app-header .toggle-btn { display: none; }
}

.card {
  background: var(--surface-primary);
  padding: 32px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  margin-bottom: 32px;
  box-shadow: none;
}

@media (max-width: 768px) {
  .card {
    padding: 20px;
  }
}

.card:hover {
  border-color: var(--muted);
}

.card:focus-within {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.card.active,
.card.selected {
  border: 2px solid var(--border-strong);
}

.studio-card {
  max-width: 1100px;
  margin: 32px auto;
}

/* --- Common Form Styles --- */
label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 11px;
}

select,
textarea,
input[type="text"] {
  width: 100%;
  background: #ffffff;
  color: var(--text);
  border: 1px solid #E0E0E0;
  border-radius: 2px;
  padding: 8px 12px;
  font-size: 16px;
  min-height: 36px;
  outline: none;
  box-sizing: border-box;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) inset;
}

select:focus,
textarea:focus,
input[type="text"]:focus {
  border-color: #000000;
  background: #ffffff;
  outline: none;
  box-shadow: 0 0 0 1px #000000;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

@media (max-width: 768px) {
  select,
  textarea,
  input[type="text"] {
    padding: 12px 14px;
    font-size: 17px;
    min-height: 44px;
  }

  textarea {
    min-height: 160px;
  }
}

button:focus-visible,
.btn:focus-visible,
.btn-primary:focus-visible,
.sample-btn:focus-visible,
.toggle-btn:focus-visible,
.collection-cta:focus-visible,
.nav-item:focus-visible,
.btn-logout:focus-visible,
.btn-charge:focus-visible,
.charge-option:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

button:disabled,
.btn:disabled,
.sample-btn:disabled,
.collection-cta:disabled,
input:disabled,
select:disabled,
textarea:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* --- Collections --- */
.hero {
  max-width: 1000px;
  margin: 0 auto 32px auto;
}

.hero-eyebrow {
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 8px 0;
}

.hero-title {
  margin: 0 0 8px 0;
  font-size: 2.2rem;
}

.hero-sub {
  color: var(--muted);
  margin: 0;
  max-width: 720px;
}

.collection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  max-width: 1000px;
  margin: 32px auto 0 auto;
}

.collection-card {
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 16px;
  box-shadow: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.collection-card:hover {
  border-color: var(--muted);
}

.collection-card:focus-within {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.collection-card.active,
.collection-card.selected {
  border: 2px solid var(--border-strong);
}


.collection-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.collection-icon {
  width: 38px;
  height: 38px;
  border-radius: 2px;
  background: var(--surface-secondary);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.collection-icon .icon-svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.collection-pill {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--border-light);
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--surface-secondary);
}

.collection-title {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0;
}

.collection-desc {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

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

.tag {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 4px;
  background: var(--surface-secondary);
  border: 1px solid var(--border-light);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.collection-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
}

.collection-stat {
  font-size: 0.78rem;
  color: var(--muted);
}

.collection-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 2px;
  background: var(--surface-primary);
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  border: 1px solid var(--border-light);
  box-shadow: none;
}

.collection-cta:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.collection-cta:active {
  border: 2px solid var(--border-strong);
}

/* --- Qwen3-TTS Studio --- */
.card .header-container {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}

.title-group {
  flex: 1;
  min-width: 250px;
}

.studio-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
  gap: 24px;
}

@media (max-width: 960px) {
  .studio-grid {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: #ffffff;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 4px;
  padding: 16px;
  box-shadow: none;
}

.panel-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin: 0 0 16px 0;
}

.balance-box {
  background: #ffffff;
  padding: 16px 24px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.12);
  text-align: right;
  min-width: 140px;
}

.row { margin-bottom: 32px; }

.action-area { text-align: right; }

button.generate-btn {
  width: 100%;
  max-width: 300px;
  border: 1px solid var(--border-light);
  cursor: pointer;
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 16px;
  font-weight: bold;
  color: var(--text);
  background: var(--surface-primary);
  box-shadow: none;
  transition: all 0.2s ease;
}

@media (min-width: 768px) {
  button.generate-btn { width: auto; }
}

button.generate-btn:active {
  border: 2px solid var(--border-strong);
}

button.generate-btn:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

button.generate-btn:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

button.generate-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.result-box {
  margin-top: 32px;
  padding: 24px;
  background: var(--surface-secondary);
  border-radius: 4px;
  border: 1px solid var(--border-light);
  text-align: center;
}

.meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  letter-spacing: 0;
}

audio {
  width: 100%;
  margin-top: 16px;
}

.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  margin-right: 8px;
  vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 3px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* --- Voice Design --- */
.design-container {
  max-width: 850px;
  margin: 0 auto;
}

.params-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  background: #ffffff;
  padding: 24px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.12);
  margin-bottom: 32px;
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkbox-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.checkbox-label {
  background: var(--surface-secondary);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  border: 1px solid var(--border-light);
  transition: all 0.2s;
  user-select: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.checkbox-label:hover {
  border-color: var(--muted);
}

.checkbox-label:has(input:checked) {
  background: var(--surface-primary);
  color: var(--text);
  border: 2px solid var(--border-strong);
}

.checkbox-label input { display: none; }

.sample-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 8px;
}

.sample-btn-group { display: flex; gap: 8px; }

.sample-btn {
  background: var(--surface-secondary);
  color: var(--text);
  border: 1px solid var(--border-light);
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 12px;
  cursor: pointer;
  transition: 0.2s;
}

.sample-btn:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.sample-btn:active {
  border: 2px solid var(--border-strong);
}

.gen-btn {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-primary);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  font-weight: 800;
  font-size: 1.1rem;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: none;
}

.gen-btn:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.gen-btn:disabled {
  opacity: 0.6;
  transform: none;
  cursor: not-allowed;
}

.gen-btn:active {
  border: 2px solid var(--border-strong);
}

.gen-btn:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.design-container .result-box {
  margin-top: 32px;
  padding: 24px;
  background: var(--surface-secondary);
  border-radius: 4px;
  border: 1px solid var(--border-light);
  text-align: center;
  animation: slideUp 0.5s ease-out;
}

@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Voice Clone / Generate Voice Clone --- */
.page {
  max-width: 980px;
  margin: 0 auto;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.grid-main {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 16px;
}

@media (max-width: 960px) {
  .grid-main {
    grid-template-columns: 1fr;
  }
}

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

.step-index {
  width: 28px;
  height: 28px;
  border-radius: 2px;
  background: var(--surface-secondary);
  border: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
}

.panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.file-input {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.clone-mode-toggle {
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.9rem;
  white-space: nowrap;
}

.upload-controls {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.upload-drop {
  border: 1px dashed var(--border-strong);
  background: var(--surface-secondary);
  padding: 20px;
  border-radius: 6px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 260px;
  flex: 1 1 260px;
}

.upload-drop:hover {
  border-color: var(--focus);
}

.upload-drop.dragging {
  border-color: var(--focus);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.08);
  background: var(--surface-primary);
}

.upload-title {
  font-weight: 600;
}

.upload-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 6px;
}

.clone-pane .status {
  margin-top: 6px;
}

.btn {
  border: 1px solid var(--border-light);
  background: var(--surface-secondary);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 2px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.btn.recording {
  border: 2px solid var(--border-strong);
  background: var(--surface-primary);
}

.btn-primary {
  background: var(--surface-primary);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 2px;
}

.btn-primary:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.btn:active,
.btn-primary:active {
  border: 2px solid var(--border-strong);
}

.btn:focus-visible,
.btn-primary:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.hidden { display: none; }

.status {
  color: var(--muted);
  font-size: 0.9rem;
}

.result {
  margin-top: 16px;
  padding: 16px;
  border-radius: 4px;
  border: 1px solid var(--border-light);
  background: var(--surface-secondary);
}

.inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* --- Account --- */
.page-title {
  margin-top: 0;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 1.5rem;
  font-weight: 800;
}

.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 32px;
  margin-bottom: 48px;
}

.info-group {
  background: var(--surface-secondary);
  padding: 16px;
  border-radius: 4px;
  margin-top: 16px;
}

.info-label {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 4px;
}

.info-value {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.wallet-card {
  border: 1px solid var(--border-light);
  position: relative;
  overflow: hidden;
}


.balance-display {
  display: flex;
  align-items: baseline;
  margin: 16px 0;
}

.balance-value {
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--text);
  line-height: 1;
}

.balance-unit {
  font-size: 1.2rem;
  color: var(--muted);
  margin-left: 8px;
  font-weight: bold;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  background: var(--surface-primary);
  border-radius: 4px;
  border: 1px solid var(--border-light);
}

.table-container:focus-within {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 600px;
}

th {
  background: var(--surface-secondary);
  text-align: left;
  padding: 16px;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-light);
}

td {
  padding: 16px;
  font-size: 0.9rem;
  border-bottom: 1px solid var(--border-light);
}

.usage-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.usage-download {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.usage-download:hover {
  text-decoration: underline;
}

tbody tr:hover td {
  background: var(--bg-2);
}

tbody tr.active td,
tbody tr.selected td {
  border-bottom: 2px solid var(--border-strong);
}

.model-badge {
  background: var(--surface-secondary);
  color: var(--text);
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.cost-negative {
  color: var(--text);
  font-weight: bold;
}

.btn-logout {
  padding: 8px 12px;
  background: var(--surface-secondary);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
}

.btn-logout:hover {
  background: var(--bg-2);
  border-color: var(--muted);
  color: var(--text);
}

.btn-logout:active {
  border: 2px solid var(--border-strong);
}

.btn-charge-disabled {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-secondary);
  color: var(--muted);
  border: 1px dashed var(--border-light);
  border-radius: 2px;
  cursor: not-allowed;
  font-weight: bold;
  margin-top: 8px;
}

.btn-charge {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-secondary);
  color: var(--text);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  cursor: pointer;
  font-weight: bold;
  margin-top: 8px;
  transition: all 0.2s;
}

.btn-charge:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.btn-charge:active {
  border: 2px solid var(--border-strong);
}

.charge-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.charge-option {
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 16px;
  text-align: left;
  background: var(--surface-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.charge-option:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.charge-option.selected {
  border: 2px solid var(--border-strong);
  background: var(--surface-primary);
}

.charge-amount {
  font-size: 1.1rem;
  font-weight: 800;
}

.charge-points {
  color: var(--muted);
  font-size: 0.85rem;
  margin-top: 4px;
}

.qr-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: var(--surface-secondary);
}

.qr-image {
  width: 100%;
  max-width: 220px;
  border-radius: 2px;
  border: 1px solid var(--border-light);
  display: block;
  margin-top: 8px;
}

/* --- Auth Pages --- */
.auth-page {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-page .card {
  width: 100%;
  max-width: 420px;
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 48px 32px;
  box-shadow: none;
  text-align: center;
  animation: fadeIn 0.6s ease-out;
}

.auth-page.login-page .card {
  max-width: 400px;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-page h1 {
  margin: 0 0 8px 0;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Arial, "Noto Sans JP", sans-serif;
}

.auth-page p.subtitle {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 32px;
}

.auth-page .input-group {
  text-align: left;
  margin-bottom: 16px;
}

.auth-page input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-light);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 2px;
  font-size: 16px;
  outline: none;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04) inset;
}

.auth-page input:focus {
  border-color: #000;
  background: #fff;
  outline: none;
  box-shadow: 0 0 0 1px #000;
}

@media (max-width: 768px) {
  .auth-page input {
    padding: 12px 14px;
    font-size: 17px;
    min-height: 44px;
  }
}

.auth-page.login-page button {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  color: var(--text);
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
  box-shadow: none;
}

.auth-page.signup-page button {
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-primary);
  border: 1px solid var(--border-light);
  border-radius: 2px;
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-top: 8px;
  box-shadow: none;
}

.auth-page.signup-page button:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.auth-page.signup-page button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.auth-page.login-page button:hover {
  background: var(--bg-2);
  border-color: var(--muted);
}

.auth-page.login-page button:active { border: 2px solid var(--border-strong); }

.auth-page.signup-page button:active { border: 2px solid var(--border-strong); }

.auth-page.login-page button:focus-visible,
.auth-page.signup-page button:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}

.auth-page.login-page button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.auth-page .error {
  background: var(--surface-secondary);
  color: var(--text);
  padding: 16px;
  border-radius: 4px;
  font-size: 14px;
  margin-bottom: 16px;
  display: none;
  border: 1px solid var(--border-light);
}

.auth-page .spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.4);
  border-radius: 999px;
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

.auth-page a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

.auth-page a:hover {
  color: var(--text);
  text-decoration: underline;
}

.auth-page a:focus-visible {
  outline: 1px solid var(--focus);
  outline-offset: 2px;
}
