

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 40px;
  padding: 0 var(--space-6);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 180ms ease;
  white-space: nowrap;
  user-select: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn svg {
  width: 18px;
  height: 18px;
}

.btn-primary {
  background: var(--color-text-primary);
  color: var(--color-text-inverted);
  border-color: var(--color-text-primary);
}

.btn-primary:hover {
  color: var(--color-text-inverted);
  background: var(--text-secondary, rgb(50, 50, 48));
  border-color: var(--text-secondary, rgb(50, 50, 48));
}

[data-theme="dark"] .btn-primary {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

[data-theme="dark"] .btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

[data-theme="dark"] #new-doc-btn,
[data-theme="dark"] .docs-new-gdocs {
  background: var(--color-primary);
}

[data-theme="dark"] #new-doc-btn:hover,
[data-theme="dark"] .docs-new-gdocs:hover {
  background: var(--color-primary-hover);
}

.btn-accent {
  background: var(--color-accent);
  color: var(--color-text-inverted);
  border-color: var(--color-accent);
}

.btn-accent:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
}

.btn-secondary {
  background: var(--color-card);
  color: var(--color-text-primary);
  border: 1px solid var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-bg);
  border-color: var(--color-text-primary);
  color: var(--color-text-primary);
}

.btn-danger {
  background: var(--color-error);
  color: var(--color-text-inverted);
  border-color: var(--color-error);
}

.btn-danger:hover {
  background: var(--color-error-hover);
  border-color: var(--color-error-hover);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
}

.btn-ghost:hover {
  background: var(--color-hover);
  color: var(--color-text-primary);
}

.btn-sm {
  height: 32px;
  padding: 0 var(--space-4);
  font-size: var(--font-size-sm);
}

.btn-lg {
  height: 48px;
  padding: 0 var(--space-8);
  font-size: var(--font-size-lg);
}

.btn-icon {
  width: 40px;
  padding: 0;
}

.btn-icon.btn-sm {
  width: 32px;
}

.card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-card);
  padding: var(--space-6);
  transition: box-shadow var(--transition);
}

.card-hover:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-4);
}

.card-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.input-label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
}

.input {
  height: 42px;
  padding: 0 var(--space-4);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-card);
  font-size: var(--font-size-base);
  color: var(--color-text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.input::placeholder {
  color: var(--color-text-secondary);
}

.input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
}

.input-error {
  border-color: var(--color-error);
}

.input-error:focus {
  box-shadow: 0 0 0 3px rgba(192, 50, 33, 0.15);
}

.error-text {
  font-size: var(--font-size-xs);
  color: var(--color-error);
}

textarea.input {
  height: auto;
  min-height: 80px;
  padding: var(--space-3) var(--space-4);
  resize: vertical;
}

select.input {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A92A6' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  cursor: pointer;
}

.toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-track {
  width: 44px;
  height: 24px;
  background: var(--color-border, #ced4da);
  border-radius: 12px;
  position: relative;
  transition: background var(--transition);
}

.toggle input:checked + .toggle-track {
  background: var(--color-primary);
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--color-text-inverted, #ffffff);
  border-radius: var(--radius-full);
  transition: transform var(--transition);
  box-shadow: var(--shadow-sm);
}

.toggle input:checked + .toggle-track::after {
  transform: translateX(20px);
}

.toggle-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
}

.badge-success {
  background: var(--color-success-light);
  color: var(--color-success);
}

.badge-warning {
  background: var(--color-warning-light);
  color: var(--color-warning);
}

.badge-error {
  background: var(--color-error-light);
  color: var(--color-error);
}

.badge-primary {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.kbd {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.08);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-relaxed);
}

.score-dot {
  width: 12px;
  height: 12px;
  border-radius: var(--radius-full);
  display: inline-block;
}

.score-dot.score-good { background: var(--color-success); }
.score-dot.score-medium { background: var(--color-warning); }
.score-dot.score-bad { background: var(--color-error); }

.tool-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-6);
}

.tool-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-card);
  padding: var(--space-6) var(--space-6) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  min-height: 140px;
}

.tool-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}

.tool-card--writing   { background: linear-gradient(135deg, #eff6ff 0%, #ffffff 60%); }
.tool-card--grammar   { background: linear-gradient(135deg, #ecfdf5 0%, #ffffff 60%); }
.tool-card--translate { background: linear-gradient(135deg, #f5f3ff 0%, #ffffff 60%); }
.tool-card--chat      { background: linear-gradient(135deg, #fffbeb 0%, #ffffff 60%); }
.tool-card--tts,
.tool-card--laes      { background: linear-gradient(135deg, #fdf2f8 0%, #ffffff 60%); }
.tool-card--notes     { background: linear-gradient(135deg, #ecfeff 0%, #ffffff 60%); }

.tool-card-deco {
  position: absolute;
  top: 4px;
  right: -8px;
  width: 100px;
  height: 100px;
  opacity: 0.12;
  pointer-events: none;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.tool-card:hover .tool-card-deco {
  opacity: 0.2;
  transform: scale(1.05);
}

.tool-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--space-1);
}

.tool-card-icon svg {
  width: 22px;
  height: 22px;
}

.tool-card--writing .tool-card-icon   { background: rgba(59, 130, 246, 0.14); }
.tool-card--writing .tool-card-icon svg { color: #3b82f6; }
.tool-card--grammar .tool-card-icon   { background: rgba(34, 197, 94, 0.14); }
.tool-card--grammar .tool-card-icon svg { color: #22c55e; }
.tool-card--translate .tool-card-icon { background: rgba(139, 92, 246, 0.14); }
.tool-card--translate .tool-card-icon svg { color: #8b5cf6; }
.tool-card--chat .tool-card-icon      { background: rgba(245, 158, 11, 0.14); }
.tool-card--chat .tool-card-icon svg  { color: #f59e0b; }
.tool-card--tts .tool-card-icon,
.tool-card--laes .tool-card-icon      { background: rgba(236, 72, 153, 0.14); }
.tool-card--tts .tool-card-icon svg,
.tool-card--laes .tool-card-icon svg  { color: #ec4899; }
.tool-card--notes .tool-card-icon     { background: rgba(6, 182, 212, 0.14); }
.tool-card--notes .tool-card-icon svg { color: #06b6d4; }

.tool-card-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  position: relative;
}

.tool-card-description {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-normal);
  position: relative;
}

.tool-card-stat {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  margin-top: auto;
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-divider, rgba(0, 0, 0, 0.06));
  position: relative;
}

.tool-card-stat strong {
  color: var(--color-text-primary);
}

[data-theme="dark"] .tool-card--writing   { background: linear-gradient(135deg, rgba(59,130,246,0.08) 0%, var(--color-card) 60%); }
[data-theme="dark"] .tool-card--grammar   { background: linear-gradient(135deg, rgba(34,197,94,0.08) 0%, var(--color-card) 60%); }
[data-theme="dark"] .tool-card--translate { background: linear-gradient(135deg, rgba(139,92,246,0.08) 0%, var(--color-card) 60%); }
[data-theme="dark"] .tool-card--chat      { background: linear-gradient(135deg, rgba(245,158,11,0.08) 0%, var(--color-card) 60%); }
[data-theme="dark"] .tool-card--tts,
[data-theme="dark"] .tool-card--laes      { background: linear-gradient(135deg, rgba(236,72,153,0.08) 0%, var(--color-card) 60%); }
[data-theme="dark"] .tool-card--notes     { background: linear-gradient(135deg, rgba(6,182,212,0.08) 0%, var(--color-card) 60%); }

.tip-card {
  background: var(--color-primary-light);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

.tip-card-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.tip-card-label {
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.tip-card-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-primary);
  margin-top: 2px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.stat-card {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  border: none;
  box-shadow: var(--shadow-card);
  padding: 20px 24px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.stat-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.stat-card-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stat-card-label {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.stat-card-value {
  font-size: 1.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--color-text-primary);
  line-height: var(--line-height-tight);
}

.stat-card-trend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-medium);
  margin-top: 12px;
}

.stat-card-trend.positive { color: var(--color-success); }
.stat-card-trend.negative { color: var(--color-error); }

.stat-card-sparkline {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 48px;
  margin-top: 12px;
}

.sparkline-bar {
  flex: 1;
  background: rgba(var(--color-primary-rgb), 0.2);
  border-radius: 3px;
  min-height: 6px;
  transition: background 0.2s;
}

.sparkline-bar.active {
  background: var(--color-primary);
}

.stat-card:hover .sparkline-bar {
  background: rgba(var(--color-primary-rgb), 0.3);
}

.stat-card:hover .sparkline-bar.active {
  background: var(--color-primary);
}

.stat-card-progress {
  height: 6px;
  background: var(--color-bg);
  border-radius: 3px;
  margin-top: 14px;
  overflow: hidden;
}

.stat-card-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #03c3ec, var(--color-primary));
  border-radius: 3px;
  transition: width 1s ease;
}

.stat-card-change {
  font-size: var(--font-size-xs);
  margin-top: var(--space-1);
}

.stat-card-change.positive { color: var(--color-success); }
.stat-card-change.negative { color: var(--color-error); }

.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-16) var(--space-8);
  text-align: center;
}

.empty-state svg {
  width: 80px;
  height: 80px;
  color: var(--color-text-secondary);
  opacity: 0.3;
  margin-bottom: var(--space-6);
}

.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text-primary);
  margin-bottom: var(--space-2);
}

.empty-state-text {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-bottom: var(--space-6);
}

.table-wrapper {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th {
  text-align: left;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-secondary);
  text-transform: capitalize;
  letter-spacing: 0.2px;
  padding: var(--space-3) var(--space-6);
  background: var(--color-bg);
  border-bottom: 1px solid transparent;
}

.table td {
  padding: var(--space-3) var(--space-6);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-base);
  color: var(--color-text-secondary);
}

.table tr:hover td {
  background: var(--color-hover);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal {
  background: var(--color-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  padding: var(--space-6);
  width: 90%;
  max-width: 480px;
  transform: scale(0.95);
  transition: transform var(--transition);
}

.modal-overlay.active .modal {
  transform: scale(1);
}

.modal-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  margin-bottom: var(--space-4);
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--space-3);
  margin-top: var(--space-6);
}

.accordion-item {
  border-bottom: 1px solid var(--color-border);
}

.accordion-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) 0;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-primary);
  text-align: left;
}

.accordion-trigger svg {
  width: 20px;
  height: 20px;
  transition: transform var(--transition);
  color: var(--color-text-secondary);
}

.accordion-item.open .accordion-trigger svg {
  transform: rotate(180deg);
}

.accordion-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 300ms ease;
}

.accordion-item.open .accordion-content {
  max-height: 500px;
}

.accordion-body {
  padding: 0 0 var(--space-4) 0;
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  line-height: var(--line-height-relaxed);
}

.search-bar {
  position: relative;
}

.search-bar svg {
  position: absolute;
  left: var(--space-3);
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--color-text-secondary);
}

.search-bar .input {
  padding-left: 40px;
  width: 100%;
}

.tabs {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  gap: var(--space-1);
}

.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
}

.tab:hover {
  color: var(--color-text-primary);
}

.tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-full);
  animation: spin 600ms linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.toast-container {
  position: fixed;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.toast {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(16px) saturate(1.6);
  -webkit-backdrop-filter: blur(16px) saturate(1.6);
  color: var(--color-text-primary, #1e293b);
  border-radius: 100px;
  border: 1px solid var(--color-border, rgba(0,0,0,0.08));
  box-shadow: var(--shadow-dropdown);
  padding: 10px 20px;
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-medium);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 220px;
  animation: slideIn 200ms ease;
}

.toast.toast-success { border-left: 3px solid var(--color-success, #059669); }
.toast.toast-error { border-left: 3px solid var(--color-error, #dc2626); }
.toast.toast-warning { border-left: 3px solid var(--color-warning, #d97706); }
.toast.toast-info { border-left: 3px solid var(--color-primary, #696cff); }
[data-theme="dark"] .toast {
  background: rgba(26, 32, 53, 0.78);
  color: #e2e2e8;
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 6px -1px rgba(0,0,0,0.2), 0 12px 24px -4px rgba(0,0,0,0.3);
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ── Word Limit Modal (design system v2) ── */

.wl-modal-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-overlay-light, rgba(0, 0, 0, 0.3));
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: wl-fade-in 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wl-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.wl-modal {
  background: var(--color-surface-solid, #ffffff);
  border-radius: var(--radius-lg);
  border: 0.5px solid var(--color-border, rgba(31, 31, 30, 0.15));
  box-shadow: var(--shadow-modal);
  max-width: 340px;
  width: 100%;
  padding: 32px 28px 28px;
  position: relative;
  text-align: center;
  font-family: var(--font-family);
  animation: wl-pop 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes wl-pop {
  from { transform: translateY(4px) scale(0.98); opacity: 0; }
  to { transform: translateY(0) scale(1); opacity: 1; }
}

.wl-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  color: var(--text-muted, rgb(115, 113, 108));
  cursor: pointer;
  z-index: 2;
  line-height: 1;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 180ms ease, color 180ms ease;
}
.wl-modal-close:hover {
  background: var(--color-hover);
  color: var(--text-primary, rgb(19, 19, 19));
}
.wl-modal-close svg { width: 16px; height: 16px; }

.wl-modal-emoji {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 24px;
}

.wl-modal-stat {
  margin-bottom: 0;
}

.wl-modal-used {
  font-size: 42px;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary, rgb(19, 19, 19));
  line-height: 1;
  display: block;
  letter-spacing: -0.4px;
}

.wl-modal-of {
  font-size: var(--font-size-base);
  color: var(--text-secondary, rgb(60, 60, 58));
  font-weight: var(--font-weight-normal, 400);
  display: block;
  margin-top: 6px;
}

.wl-modal-sub {
  font-size: 14px;
  color: var(--text-muted, rgb(115, 113, 108));
  margin: 20px 0 24px;
  line-height: 1.4;
}
.wl-modal-sub a {
  color: var(--text-primary, rgb(19, 19, 19));
  text-decoration: underline;
  text-underline-offset: 2px;
}
.wl-modal-sub a:hover {
  color: var(--text-secondary, rgb(60, 60, 58));
}

.wl-modal-actions {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.wl-modal .wl-modal-upgrade {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  border-radius: var(--radius-md);
  background: var(--text-primary, rgb(19, 19, 19));
  color: var(--color-text-inverted, #fff);
  border: none;
  text-decoration: none;
  text-align: center;
  transition: background 180ms ease;
}
.wl-modal .wl-modal-upgrade:hover {
  background: var(--text-secondary, rgb(50, 50, 48));
  text-decoration: none;
  color: var(--color-text-inverted, #fff);
}

.wl-modal-dismiss {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  font-family: inherit;
  background: transparent;
  border: none;
  color: var(--text-secondary, rgb(60, 60, 58));
  cursor: pointer;
  transition: background 180ms ease;
}
.wl-modal-dismiss:hover {
  background: var(--color-hover);
}

/* Dark mode */
[data-theme="dark"] .wl-modal-overlay {
  background: var(--color-overlay);
}
[data-theme="dark"] .wl-modal {
  background: var(--color-card, #1e2235);
  border-color: var(--border-light, rgba(255, 255, 255, 0.1));
  box-shadow: var(--shadow-modal);
}
[data-theme="dark"] .wl-modal-close {
  color: var(--color-text-secondary, #a0a0b0);
}
[data-theme="dark"] .wl-modal-close:hover {
  background: var(--color-hover);
  color: var(--color-text-primary, #e2e2e8);
}
[data-theme="dark"] .wl-modal-used {
  color: var(--color-text-primary, #e2e2e8);
}
[data-theme="dark"] .wl-modal-of {
  color: var(--color-text-secondary, #a0a0b0);
}
[data-theme="dark"] .wl-modal-sub {
  color: var(--color-text-secondary, #a0a0b0);
}
[data-theme="dark"] .wl-modal-sub a {
  color: var(--color-text-primary, #e2e2e8);
}
[data-theme="dark"] .wl-modal .wl-modal-upgrade {
  background: var(--color-text-inverted, #fff);
  color: var(--text-primary, #131313);
}
[data-theme="dark"] .wl-modal .wl-modal-upgrade:hover {
  background: var(--color-hover-strong, #e8e8e6);
}
[data-theme="dark"] .wl-modal-dismiss {
  color: var(--color-text-secondary, #a0a0b0);
}
[data-theme="dark"] .wl-modal-dismiss:hover {
  background: var(--color-hover);
}

/* Soft limit — delay text + body */
.wl-modal-delay {
  font-size: 14px;
  font-weight: 600;
  color: var(--color-warning-text, #a67200);
  margin: 4px 0 8px;
  text-align: center;
}
.wl-modal-body {
  font-size: 13px;
  color: var(--color-text-secondary);
  margin: 0 0 12px;
  line-height: 1.5;
  text-align: center;
}
[data-theme="dark"] .wl-modal-delay {
  color: var(--color-warning, #f0c040);
}

/* Persistent degradation banner */
.wl-degrade-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 16px;
  background: rgba(245, 158, 11, 0.08);
  border-bottom: 1px solid rgba(245, 158, 11, 0.25);
  font-size: 13px;
  color: var(--color-text-primary);
  z-index: 100;
  position: relative;
  animation: wl-banner-in 0.3s ease;
}
.wl-degrade-banner a {
  color: var(--color-primary);
  font-weight: 600;
}
.wl-degrade-banner-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--color-text-muted);
  padding: 2px 6px;
  border-radius: 4px;
  transition: background 150ms;
}
.wl-degrade-banner-close:hover {
  background: var(--color-hover);
}
@keyframes wl-banner-in {
  from { opacity: 0; transform: translateY(-100%); }
  to { opacity: 1; transform: translateY(0); }
}
[data-theme="dark"] .wl-degrade-banner {
  background: rgba(255, 171, 0, 0.1);
  border-bottom-color: rgba(255, 171, 0, 0.2);
}
