/* ... (Previous CSS content) ... */
:root {
  /* Cursor-like Palette (Neutral Dark) */
  --bg-app: #09090b;       /* Main content bg */
  --bg-sidebar: #000000;   /* Sidebar bg (Solid black) */
  --bg-card: #121212;      /* Card bg */
  
  --border-subtle: #27272a; /* Zinc-800 */
  --border-active: #3f3f46; /* Zinc-700 */

  --text-main: #f4f4f5;    /* Zinc-100 */
  --text-muted: #a1a1aa;   /* Zinc-400 */
  --text-dim: #52525b;     /* Zinc-600 */

  --primary-btn-bg: #ffffff;
  --primary-btn-text: #000000;
  
  --accent-blue: #3b82f6;  /* For active states/links */
  --danger: #ef4444;

  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  
  --radius-lg: 12px;
  --radius-md: 6px;
  --radius-sm: 4px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-app);
  color: var(--text-main);
  font-family: var(--font-family);
  -webkit-font-smoothing: antialiased;
  display: flex;
  font-size: 14px;
  line-height: 1.5;
}

/* Layout */
.app-container {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 240px;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 20px;
  margin-bottom: 4px;
  font-size: 1.2rem; /* Slightly larger */
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main);
  text-decoration: none;
}
.brand svg { width: 20px; height: 20px; fill: currentColor; }

.nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.15s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: #1a1a1a;
  color: var(--text-main);
}

.nav-item.active {
  background: #1a1a1a;
  color: var(--text-main);
  font-weight: 600;
}

.nav-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}
.nav-item.active .nav-icon { opacity: 1; }

/* Expandable Submenu */
.nav-expandable {
  display: flex;
  flex-direction: column;
}

.nav-submenu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 2px;
}

.nav-subitem {
  font-size: 12px !important;
  padding: 6px 12px !important;
  color: var(--text-dim) !important;
}

.nav-subitem:hover {
  color: var(--text-muted) !important;
  background: rgba(255, 255, 255, 0.03);
}

.nav-subitem.active {
  color: var(--text-main) !important;
  background: #1a1a1a;
}

.nav-expand-icon {
  opacity: 0.5;
}

.sidebar-sync-box {
  padding: 12px;
  border-top: 1px solid var(--border-subtle);
  margin-bottom: 8px;
}
.status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #52525b; /* Neutral */
}
.status-dot.active { background: #10b981; }

.btn-text {
  background: none; border: none; padding: 0;
  color: var(--text-muted); font-size: 11px;
  cursor: pointer; text-decoration: underline;
}
.btn-text:hover { color: var(--text-main); }

.user-profile {
  margin-top: 0;
  padding-top: 12px;
  border-top: 1px solid var(--border-subtle);
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 6px;
  margin-bottom: 4px;
}
.avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #27272a;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-muted);
}
.email-text {
  font-size: 12px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 48px 64px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

.view-section {
  width: 100%;
  /* animation: fadeIn 0.2s ease-out; */
}
/* @keyframes fadeIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } } */

.page-header {
  margin-bottom: 40px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-title {
  font-size: 24px;
  font-weight: 600;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}

.page-desc {
  color: var(--text-muted);
  font-size: 14px;
}

/* Auth View */
.auth-container {
  position: fixed;
  inset: 0;
  background: #000;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
}
.auth-box {
  width: 100%;
  max-width: 380px;
  padding: 32px;
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

/* Cards */
.section-card {
  background: transparent; /* Clean look */
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
}

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

.section-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--text-main);
}

/* Current Plan Display */
.current-plan-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}
.plan-large {
  font-size: 32px;
  font-weight: 600;
  color: var(--text-main);
  letter-spacing: -0.02em;
}
.status-pill {
  font-size: 12px;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
  font-weight: 500;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

/* Dropdown Menu (Styled like a popover) */
.dropdown { position: relative; }
.dropdown-trigger {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 6px 12px;
  border-radius: var(--radius-md);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.1s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.dropdown-trigger:hover {
  background: var(--border-subtle);
}
.dropdown-content {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: #18181b; /* Zinc-900 */
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  width: 220px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  display: none;
  z-index: 100;
  overflow: hidden;
  padding: 4px;
}
.dropdown-content.show { display: block; }
.menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  border-radius: 4px;
}
.menu-item:hover {
  background: #27272a;
  color: var(--text-main);
}
.menu-item.danger { color: var(--danger); }
.menu-item.danger:hover { background: rgba(239, 68, 68, 0.1); }

/* Buttons (Cursor Style) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.1s;
  border: 1px solid transparent;
}
.btn-primary {
  background: var(--primary-btn-bg);
  color: var(--primary-btn-text);
  font-weight: 600;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}
.btn-secondary {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
}
.btn-secondary:hover { background: var(--border-subtle); }

.btn-danger {
  background: transparent;
  border: 1px solid #7f1d1d;
  color: var(--danger);
}
.btn-danger:hover { background: #450a0a; }

.btn-sm {
    padding: 4px 10px;
    font-size: 11px;
}

/* Plan Navigation Buttons */
.plan-nav-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-muted);
  border-radius: 6px;
  transition: all 0.15s;
}
.plan-nav-btn:hover {
  background: rgba(168, 85, 247, 0.1);
  border-color: rgba(168, 85, 247, 0.3);
  color: var(--text-main);
}
.plan-nav-btn.active {
  background: rgba(168, 85, 247, 0.15);
  border-color: #a855f7;
  color: #a855f7;
}

.w-full { width: 100%; }

/* Input */
.input-label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.input {
  width: 100%;
  padding: 8px 12px;
  background: #000;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 13px;
  transition: border-color 0.15s;
}
.input:focus {
  outline: none;
  border-color: var(--text-muted);
}

/* Plan Grid */
.plan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}
.plan-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  cursor: pointer;
  transition: border-color 0.15s;
  display: flex;
  flex-direction: column;
}
.plan-card:hover {
  border-color: var(--text-muted);
}
.plan-price {
  font-size: 24px;
  font-weight: 600;
  margin: 8px 0 16px;
  color: var(--text-main);
}
.plan-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
  flex: 1;
}

/* API Key Box */
.api-key-box {
  font-family: 'JetBrains Mono', monospace;
  background: #000;
  padding: 12px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: 12px;
  margin: 12px 0 20px;
}

/* Contract Sync */
.contract-sync p { margin-top: 0; }

/* Modals */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5); /* Darker dim */
  backdrop-filter: blur(2px);
  z-index: 5000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-content {
  background: #09090b;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 440px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.7);
}
.modal-title { font-size: 18px; font-weight: 600; margin-top:0; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 6000;
}
.toast {
  background: #18181b;
  color: #f4f4f5;
  border: 1px solid var(--border-subtle);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  font-size: 13px;
  display: none;
}
.toast.show { display: block; animation: fadeUp 0.2s ease-out; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: translateY(0); } }

/* Utils */
.hidden { display: none !important; }
.flex { display: flex; }
.text-center { text-align: center; }
.text-sm { font-size: 13px; }
.text-muted { color: var(--text-muted); }
.mt-2 { margin-top: 8px; }

@media (max-width: 768px) {
  .app-container { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; border-right: none; border-bottom: 1px solid var(--border-subtle); }
  .main-content { padding: 24px 16px; }
}

/* ======================
   Usage (従量課金) Styles
   ====================== */

/* Nav SAMPLE Badge */
.nav-sample-badge {
  margin-left: auto;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #000;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: 0.05em;
}

/* Page SAMPLE Watermark */
.sample-watermark {
  position: absolute;
  top: 0;
  right: 0;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: #000;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 24px;
  border-radius: 0 0 0 12px;
  letter-spacing: 0.1em;
  z-index: 10;
}

/* Card SAMPLE Overlay */
.sample-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  font-weight: 800;
  color: rgba(245, 158, 11, 0.15);
  letter-spacing: 0.2em;
  pointer-events: none;
  z-index: 5;
  text-transform: uppercase;
}

/* Usage Total */
.usage-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 16px;
  padding: 20px;
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid rgba(59, 130, 246, 0.2);
  border-radius: var(--radius-md);
}

.usage-total-label {
  font-size: 14px;
  color: var(--text-muted);
}

.usage-total-amount {
  font-size: 32px;
  font-weight: 700;
  color: #60a5fa;
}

/* Usage Table */
.usage-table {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.usage-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 16px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  align-items: center;
}

.usage-row:not(.usage-header):not(.usage-footer) {
  background: rgba(255, 255, 255, 0.02);
}

.usage-header {
  background: rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.usage-footer {
  border-top: 1px solid var(--border-subtle);
  padding-top: 16px;
  margin-top: 8px;
}

.usage-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.usage-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.usage-amount {
  font-weight: 600;
  color: var(--text-main);
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
}

.pricing-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  text-align: center;
}

.pricing-icon {
  width: 32px;
  height: 32px;
  color: #60a5fa;
}

.pricing-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-main);
}

.pricing-price {
  font-size: 18px;
  font-weight: 700;
  color: #60a5fa;
}

/* Download Links */
.download-link:hover {
  background: rgba(255,255,255,0.08) !important;
  border-color: var(--border-active) !important;
}
