/* ─────────────────────────────────────────────────────────
   Delimiter.site - Design System
   Inspired by QuillBot's clean utility aesthetic
───────────────────────────────────────────────────────── */

/* Ensure [hidden] always wins over display:flex/grid set by component CSS */
[hidden] { display: none !important; }

/* ── Variables ── */
:root {
  --color-primary:       #19c37d;
  --color-primary-dark:  #15a86b;
  --color-primary-light: #f0fdf7;
  --color-primary-50:    #f0fdf7;
  --color-primary-100:   #dcfcec;

  --color-bg:            #ffffff;
  --color-surface:       #fafafa;
  --color-border:        #e5e7eb;
  --color-border-light:  #f3f4f6;

  --color-text:          #111827;
  --color-text-muted:    #374151;
  --color-text-faint:    #6b7280;

  --sidebar-left-w:      88px;
  --sidebar-right-w:     72px;
  --header-h:            52px;
  --modes-bar-h:         46px;
  --bottom-bar-h:        52px;

  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Inter, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;

  --radius-sm: 6px;
  --radius:    8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow:    0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
}

/* ── Dark mode ── */
[data-theme="dark"] {
  --color-bg:           #0f1117;
  --color-surface:      #1a1d27;
  --color-border:       #2e3146;
  --color-border-light: #252838;
  --color-text:         #e8eaf0;
  --color-text-muted:   #8b90a8;
  --color-text-faint:   #5a5f7a;
  --color-primary-50:   #0d2b20;
  --color-primary-100:  #113d2c;
}

[data-theme="dark"] body {
  -webkit-font-smoothing: antialiased;
}

[data-theme="dark"] .panel-textarea {
  color: #e8eaf0 !important;
  background: var(--color-surface);
  caret-color: var(--color-primary);
}

[data-theme="dark"] .panel-textarea[readonly] {
  color: #e8eaf0 !important;
}

[data-theme="dark"] .center-btn--secondary {
  background: var(--color-surface);
  color: var(--color-text-muted);
  border-color: var(--color-border);
}

[data-theme="dark"] .center-btn--danger {
  background: #2d1515;
}
[data-theme="dark"] .center-btn--danger:hover {
  background: #3d1a1a;
}

[data-theme="dark"] .seo-article h1,
[data-theme="dark"] .seo-article h2 {
  color: #e8eaf0;
}

[data-theme="dark"] .feedback-input,
[data-theme="dark"] .feedback-select,
[data-theme="dark"] .feedback-textarea {
  color: #e8eaf0;
  background: var(--color-surface);
}

[data-theme="dark"] .settings-select {
  color: var(--color-text);
  background: var(--color-surface);
}

[data-theme="dark"] .bookmark-tooltip {
  background: #2e3146;
}

/* ── Reset ── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-overflow-scrolling: auto;
}

body {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
}

button:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

select, input {
  font-family: inherit;
}

a {
  text-decoration: none;
  color: inherit;
}


/* ─────────────────────────────────────────────────────────
   APP SHELL
───────────────────────────────────────────────────────── */

.app-shell {
  display: flex;
  height: 100vh;
  overflow: hidden;
  background: var(--color-bg);
}


/* ─────────────────────────────────────────────────────────
   LEFT SIDEBAR
───────────────────────────────────────────────────────── */

.sidebar-left {
  width: var(--sidebar-left-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--color-border);
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--color-bg);
  z-index: 10;
}

/* Scrollbar */
.sidebar-left::-webkit-scrollbar { width: 3px; }
.sidebar-left::-webkit-scrollbar-track { background: transparent; }
.sidebar-left::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

.sidebar-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 52px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--color-border);
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-size: 18px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
  box-shadow: 0 2px 8px rgb(25 195 125 / 0.35);
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding: 8px 0;
  gap: 2px;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(var(--sidebar-left-w) - 8px);
  min-height: 68px;
  padding: 8px 4px;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
  gap: 4px;
  position: relative;
}

.nav-item:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

.nav-item.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-icon svg {
  width: 100%;
  height: 100%;
}

.nav-label {
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
}


/* ─────────────────────────────────────────────────────────
   MAIN CONTENT
───────────────────────────────────────────────────────── */

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-width: 0;
}


/* ─────────────────────────────────────────────────────────
   HEADER
───────────────────────────────────────────────────────── */

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

.header-left,
.header-right {
  flex: 1;
}

.header-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.header-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
}

.btn-ghost-sm {
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-radius: var(--radius-xl);
  transition: background 0.12s, color 0.12s;
  border: 1px solid transparent;
}

.btn-ghost-sm:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

/* ── Bookmark button ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* ── Language picker ── */
.lang-picker {
  position: relative;
}
.lang-trigger {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 8px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
  white-space: nowrap;
}
.lang-trigger:hover { border-color: var(--color-primary); }
.lang-flag { font-size: 14px; line-height: 1; }
.lang-code { letter-spacing: 0.03em; }
.lang-chevron { width: 12px; height: 12px; opacity: 0.6; transition: transform 0.15s; }
.lang-trigger[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }

.lang-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  max-height: 340px;
  overflow-y: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 200;
  padding: 4px;
}
.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.1s;
}
.lang-option:hover { background: var(--color-bg); }
.lang-option--active {
  background: var(--color-primary-50, #f0fdf7);
  color: var(--color-primary);
  font-weight: 600;
}
.lang-option-flag { font-size: 16px; flex-shrink: 0; line-height: 1; }
.lang-option-label { flex: 1; }

[data-theme="dark"] .lang-dropdown {
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.btn-bookmark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5c400;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.15s, transform 0.15s, background 0.15s;
  flex-shrink: 0;
}

.btn-bookmark svg {
  width: 18px;
  height: 18px;
  filter: drop-shadow(0 1px 2px rgb(245 196 0 / 0.5));
}

.btn-bookmark:hover {
  background: #fffbe6;
  transform: scale(1.12);
}

.btn-bookmark:active {
  transform: scale(0.95);
}

.btn-bookmark.bookmarked {
  color: #e6a800;
  animation: bookmark-pop 0.25s ease;
}

@keyframes bookmark-pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.bookmark-tooltip {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #1f2937;
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  padding: 7px 12px;
  border-radius: var(--radius);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.18s, transform 0.18s;
  z-index: 100;
}

.bookmark-tooltip kbd {
  background: #374151;
  border: 1px solid #4b5563;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: var(--font-mono);
  font-size: 11px;
}

.bookmark-tooltip.show {
  opacity: 1;
  transform: translateY(0);
}

/* ── Logged-in username in header ── */
.header-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0 4px;
  text-decoration: none;
}
.header-username:hover { color: var(--color-primary); }

/* ── Sign up button ── */
.btn-primary-sm {
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-xl);
  transition: background 0.12s, box-shadow 0.12s;
  box-shadow: 0 1px 4px rgb(25 195 125 / 0.30);
}

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


/* ─────────────────────────────────────────────────────────
   MODES BAR
───────────────────────────────────────────────────────── */

.modes-bar {
  height: var(--modes-bar-h);
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-shrink: 0;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
}

.modes-bar::-webkit-scrollbar { height: 0; }

.modes-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
  margin-right: 4px;
  flex-shrink: 0;
}

.mode-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-shrink: 0;
}

.mode-tab {
  padding: 0 12px;
  height: var(--modes-bar-h);
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s;
  white-space: nowrap;
  border-radius: 0;
}

.mode-tab:hover {
  color: var(--color-text);
}

.mode-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.modes-spacer {
  flex: 1;
}

.modes-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.modes-control-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.modes-select {
  height: 30px;
  padding: 0 28px 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  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='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  transition: border-color 0.12s;
}

.modes-select:hover,
.modes-select:focus {
  border-color: var(--color-primary);
  outline: none;
}

.custom-input-wrap {
  display: flex;
  align-items: center;
}

.custom-input {
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--color-text);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 100px;
  transition: border-color 0.12s;
}

.custom-input:focus {
  border-color: var(--color-primary);
  outline: none;
}

.btn-icon-sm {
  display: flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  white-space: nowrap;
}

.btn-icon-sm svg {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.btn-icon-sm:hover,
.btn-icon-sm.active {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}


/* ─────────────────────────────────────────────────────────
   OPTIONS PANEL
───────────────────────────────────────────────────────── */

.options-panel {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-primary-50);
  padding: 10px 20px;
  flex-shrink: 0;
}

.options-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.option-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}

.option-toggle input[type="checkbox"] {
  display: none;
}

.toggle-track {
  position: relative;
  width: 32px;
  height: 18px;
  background: var(--color-border);
  border-radius: 9px;
  transition: background 0.18s;
  flex-shrink: 0;
}

.toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s;
}

.option-toggle input:checked + .toggle-track {
  background: var(--color-primary);
}

.option-toggle input:checked + .toggle-track::after {
  transform: translateX(14px);
}

.toggle-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text);
}


/* ─────────────────────────────────────────────────────────
   TOOL AREA
───────────────────────────────────────────────────────── */

.tool-area {
  flex: none;
  display: flex;
  overflow: hidden;
  height: calc(100vh - var(--header-h) - var(--modes-bar-h) - var(--bottom-bar-h));
}

.panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* kept for reference - replaced by .panel-center */
.panel-divider {
  width: 1px;
  background: var(--color-border);
  flex-shrink: 0;
}


/* ─────────────────────────────────────────────────────────
   CENTER CONTROL PANEL
───────────────────────────────────────────────────────── */

.panel-center {
  width: 112px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  background: var(--color-bg);
}

.center-controls {
  display: flex;
  flex-direction: column;
  width: calc(100% - 16px);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}

/* Join-with dropdown (gray band at top) */
.center-select-wrap {
  background: #efefef;
  border-bottom: 1px solid #d8d8d8;
}

.center-select {
  width: 100%;
  height: 44px;
  border: none;
  background: transparent;
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: #222;
  text-align: center;
  cursor: pointer;
  padding: 0 4px;
  appearance: none;
  -webkit-appearance: none;
  letter-spacing: 0.03em;
}

.center-select:focus { outline: none; }

/* Action buttons */
.center-btn {
  width: 100%;
  height: 52px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: filter 0.12s, transform 0.08s;
  border-top: 1px solid rgb(0 0 0 / 0.08);
}

.center-btn svg {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
}

.center-btn--primary {
  background: var(--color-primary);
}
.center-btn--primary:hover { background: var(--color-primary-dark); }
.center-btn--primary:active { transform: scale(0.96); }

.center-btn--secondary {
  background: var(--color-surface);
  color: var(--color-text-muted);
}
.center-btn--secondary:hover { background: var(--color-primary-50); color: var(--color-primary); }
.center-btn--secondary:active { transform: scale(0.96); }

.center-btn--danger {
  background: #fff5f5;
}
.center-btn--danger:hover { background: #fee2e2; }
.center-btn--danger:active { transform: scale(0.96); }

/* Custom join input (below the control box) */
.center-custom-wrap {
  margin-top: 10px;
  padding: 0 8px;
  width: 100%;
}

.center-custom-input {
  width: 100%;
  height: 30px;
  padding: 0 8px;
  font-size: 13px;
  font-family: var(--font-mono);
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-align: center;
  transition: border-color 0.12s;
}

.center-custom-input:focus {
  border-color: var(--color-primary);
  outline: none;
}

.panel-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 6px;
  flex-shrink: 0;
}

.panel-heading {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.panel-header-actions {
  display: flex;
  gap: 4px;
}

.icon-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  transition: background 0.1s, color 0.1s;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--color-surface);
  color: var(--color-text);
}

/* Panel body: line numbers + textarea side by side */
.panel-body {
  flex: 1;
  display: flex;
  overflow: hidden;
  position: relative;
}

.line-numbers {
  flex-shrink: 0;
  width: 36px;
  padding: 12px 0;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border-light);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  user-select: none;
  pointer-events: none;
}

.line-numbers span {
  display: block;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--color-text-faint);
  line-height: 1.6;
  padding: 0 8px 0 4px;
  height: 22.4px; /* matches textarea line-height of 1.6 × 14px */
}

.panel-textarea {
  flex: 1;
  resize: none;
  border: none;
  outline: none;
  padding: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
  font-family: var(--font-mono);
  color: #000000;
  -webkit-font-smoothing: subpixel-antialiased;
  -moz-osx-font-smoothing: auto;
  background: transparent;
  min-height: 0;
  width: 100%;
}

.panel-textarea::placeholder {
  color: var(--color-text-faint);
  font-family: var(--font-sans);
  font-style: italic;
}

.panel-textarea[readonly] {
  color: #000000;
}

/* Panel action buttons (paste / sample) */
.panel-actions-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-top: 1px solid var(--color-border-light);
  flex-shrink: 0;
}

.action-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-bg);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.action-pill svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.action-pill:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.action-or {
  font-size: 13px;
  color: var(--color-text-faint);
}


/* ─────────────────────────────────────────────────────────
   BOTTOM BAR
───────────────────────────────────────────────────────── */

.bottom-bar {
  height: var(--bottom-bar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-bg);
  flex-shrink: 0;
  gap: 8px;
}

.bottom-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bottom-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.item-count {
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  min-width: 64px;
}

.btn-bottom-ghost {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-bg);
  transition: color 0.12s, border-color 0.12s, background 0.12s;
}

.btn-bottom-ghost svg {
  width: 14px;
  height: 14px;
}

.btn-bottom-ghost:hover {
  color: var(--color-text);
  border-color: #d1d5db;
  background: var(--color-surface);
}

.btn-bottom-primary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  background: var(--color-primary);
  border-radius: var(--radius-xl);
  transition: background 0.12s, box-shadow 0.12s, transform 0.08s;
  box-shadow: 0 2px 8px rgb(25 195 125 / 0.35);
}

.btn-bottom-primary svg {
  width: 15px;
  height: 15px;
}

.btn-bottom-primary:hover {
  background: var(--color-primary-dark);
  box-shadow: 0 3px 12px rgb(25 195 125 / 0.45);
}

.btn-bottom-primary:active {
  transform: scale(0.97);
}


/* ─────────────────────────────────────────────────────────
   RIGHT SIDEBAR
───────────────────────────────────────────────────────── */

.sidebar-right {
  width: var(--sidebar-right-w);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0;
  gap: 2px;
  border-left: 1px solid var(--color-border);
  background: var(--color-bg);
  overflow-y: auto;
}

.sidebar-right-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: calc(var(--sidebar-right-w) - 8px);
  min-height: 58px;
  padding: 8px 4px;
  gap: 4px;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  background: none;
  border: none;
}

.sidebar-right-btn:hover,
.sidebar-right-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
}

a.sidebar-right-btn {
  text-decoration: none;
}

.sidebar-right-icon {
  width: 20px;
  height: 20px;
}

.sidebar-right-icon svg {
  width: 100%;
  height: 100%;
}

.sidebar-right-label {
  font-size: 10px;
  font-weight: 500;
  text-align: center;
  line-height: 1.3;
  white-space: normal;
  word-break: break-word;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 100%;
}

.sidebar-right-sep {
  width: 32px;
  height: 1px;
  background: var(--color-border);
  margin: 4px 0;
}


/* ─────────────────────────────────────────────────────────
   TOAST NOTIFICATION
───────────────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 72px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  background: #1f2937;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  z-index: 100;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--color-primary);
}


/* ─────────────────────────────────────────────────────────
   DRAWERS (History / Settings)
───────────────────────────────────────────────────────── */

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.25);
  z-index: 200;
  opacity: 0;
  transition: opacity 0.2s;
}
.drawer-backdrop.open { opacity: 1; }

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 320px;
  height: 100vh;
  background: var(--color-bg);
  border-left: 1px solid var(--color-border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.22s cubic-bezier(.4,0,.2,1);
  box-shadow: -4px 0 24px rgba(0,0,0,0.08);
}
.drawer.open { transform: translateX(0); }

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 52px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}

.drawer-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--color-text);
}

.drawer-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  color: var(--color-text-muted);
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.12s, color 0.12s;
}
.drawer-close:hover { background: var(--color-surface); color: var(--color-text); }
.drawer-close svg { width: 16px; height: 16px; }

.drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 0;
}

.drawer-empty {
  padding: 24px 16px;
  color: var(--color-text-muted);
  font-size: 0.875rem;
  text-align: center;
  line-height: 1.6;
}

.drawer-footer {
  border-top: 1px solid var(--color-border);
  padding: 10px 16px;
  flex-shrink: 0;
}

.drawer-footer-btn {
  font-size: 0.8125rem;
  color: #ef4444;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
}
.drawer-footer-btn:hover { text-decoration: underline; }

/* History entries */
.history-entry {
  padding: 10px 16px;
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: background 0.1s;
}
.history-entry:hover { background: var(--color-surface); }

.history-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 4px;
}

.history-tool {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
}

.history-time {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

.history-preview {
  font-size: 0.8125rem;
  color: var(--color-text);
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.history-count {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin-top: 2px;
}

/* Settings */
.settings-section {
  padding: 12px 16px 4px;
  border-bottom: 1px solid var(--color-border);
}
.settings-section:last-child { border-bottom: none; }

.settings-section-title {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 10px;
}

.settings-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 0;
  cursor: pointer;
}

.settings-label {
  font-size: 0.875rem;
  color: var(--color-text);
}

.settings-select {
  font-size: 0.8125rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 3px 6px;
  background: var(--color-bg);
  color: var(--color-text);
  cursor: pointer;
}

.settings-checkbox {
  width: 16px;
  height: 16px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

/* Signup gate modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.modal-overlay.open { opacity: 1; }

.modal-box {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  max-width: 360px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}

.modal-icon {
  width: 48px;
  height: 48px;
  background: var(--color-primary-50);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: var(--color-primary);
}
.modal-icon svg { width: 24px; height: 24px; }

.modal-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 10px;
}

.modal-body {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 22px;
}

.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.modal-btn-primary {
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius);
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  display: block;
  transition: background 0.15s;
}
.modal-btn-primary:hover { background: var(--color-primary-dark); }

.modal-btn-ghost {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  cursor: pointer;
  padding: 6px;
}
.modal-btn-ghost:hover { color: var(--color-text); }

/* Feedback form */
.feedback-form {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.feedback-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.feedback-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--color-text);
}

.feedback-optional {
  font-weight: 400;
  color: var(--color-text-muted);
}

.feedback-input,
.feedback-select,
.feedback-textarea {
  font-size: 0.875rem;
  font-family: var(--font-sans);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 7px 10px;
  background: var(--color-bg);
  color: #000;
  transition: border-color 0.12s, box-shadow 0.12s;
  width: 100%;
  box-sizing: border-box;
}

.feedback-input:focus,
.feedback-select:focus,
.feedback-textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgb(25 195 125 / 0.12);
}

.feedback-textarea {
  resize: vertical;
  min-height: 100px;
}

.feedback-submit {
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  align-self: flex-start;
}

.feedback-submit:hover { background: var(--color-primary-dark, #15a86b); }

.feedback-status {
  font-size: 0.8125rem;
  min-height: 18px;
}
.feedback-status.success { color: var(--color-primary); font-weight: 600; }
.feedback-status.error   { color: #ef4444; }

/* ─────────────────────────────────────────────────────────
   SEO ARTICLE
───────────────────────────────────────────────────────── */

.seo-article {
  max-width: 860px;
  margin: 32px auto 48px;
  padding: 0 24px;
  color: var(--color-text);
  line-height: 1.75;
  font-size: 0.9375rem;
}

.seo-article h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #000;
  margin: 0 0 16px;
  line-height: 1.3;
}

.seo-article h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #000;
  margin: 32px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--color-border);
}

.seo-article h3 {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
  margin: 20px 0 6px;
}

.seo-article p {
  margin: 0 0 14px;
}

.seo-article a {
  color: #2563eb;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.seo-article a:hover {
  color: #1d4ed8;
}
[data-theme="dark"] .seo-article a {
  color: #60a5fa;
}
[data-theme="dark"] .seo-article a:hover {
  color: #93c5fd;
}

.seo-article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 24px;
  font-size: 0.875rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--color-border);
}
.seo-article thead {
  background: var(--color-primary);
}
.seo-article thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.seo-article tbody tr {
  border-top: 1px solid var(--color-border);
}
.seo-article tbody tr:nth-child(even) {
  background: var(--color-surface);
}
.seo-article tbody tr:hover {
  background: var(--color-primary-50, #f0fdf7);
}
.seo-article td {
  padding: 10px 16px;
  vertical-align: top;
  line-height: 1.5;
}
.seo-article td code,
.seo-article th code {
  font-size: 0.8em;
}
[data-theme="dark"] .seo-article thead {
  background: var(--color-primary-dark, #15a86b);
}
[data-theme="dark"] .seo-article tbody tr:nth-child(even) {
  background: rgba(255,255,255,0.04);
}
[data-theme="dark"] .seo-article tbody tr:hover {
  background: rgba(25,195,125,0.08);
}

.seo-article code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--color-primary-dark, #0f7a4e);
}

/* ─────────────────────────────────────────────────────────
   RELATED TOOLS
───────────────────────────────────────────────────────── */

.related-tools {
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--color-border);
}
.related-tools-heading {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.related-tool-card {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 11px 14px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color 0.12s, background 0.12s;
}
.related-tool-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-50);
}
.related-tool-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
}
.related-tool-card:hover .related-tool-card-name { color: var(--color-primary); }
.related-tool-card-desc {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* ─────────────────────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────────────────────── */

/* ── Dynamic viewport height (mobile keyboard-aware) ── */
@supports (height: 100dvh) {
  html, body  { height: 100dvh; }
  .app-shell  { height: 100dvh; }
  .tool-area  { height: calc(100dvh - var(--header-h) - var(--modes-bar-h) - var(--bottom-bar-h)); }
  .tt-layout  { height: calc(100dvh - var(--header-h) - var(--modes-bar-h) - var(--bottom-bar-h)); }
}

/* ── Mobile hamburger button ── */
.btn-mobile-menu {
  display: none;
  width: 34px;
  height: 34px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius);
  color: var(--color-text-muted);
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.12s, color 0.12s;
}
.btn-mobile-menu:hover { background: var(--color-surface); color: var(--color-text); }
.btn-mobile-menu svg   { width: 20px; height: 20px; }

/* ── Mobile nav overlay ── */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.mobile-nav-overlay.open { opacity: 1; pointer-events: all; }

.mobile-nav-panel {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(300px, 85vw);
  background: var(--color-bg);
  border-right: 1px solid var(--color-border);
  z-index: 501;
  display: flex;
  flex-direction: column;
  transform: translateX(-100%);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.mobile-nav-panel.open { transform: translateX(0); }

.mobile-nav-header {
  height: 52px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  gap: 10px;
}

.mobile-nav-logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: -1px;
  flex-shrink: 0;
}

.mobile-nav-site-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--color-text);
}

.mobile-nav-links { padding: 8px 0; flex: 1; }

.mobile-nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}

.mobile-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.mobile-nav-item:hover  { background: var(--color-surface); color: var(--color-text); }
.mobile-nav-item.active { color: var(--color-primary); background: var(--color-primary-50); }

/* ── Text tool settings toggle (mobile only) ── */
.btn-tt-settings-toggle {
  display: none;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  flex-shrink: 0;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  white-space: nowrap;
}
.btn-tt-settings-toggle svg { width: 15px; height: 15px; flex-shrink: 0; }
.btn-tt-settings-toggle:hover,
.btn-tt-settings-toggle.active {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* ── 768px: tablets and below ── */
@media (max-width: 768px) {
  :root {
    --sidebar-left-w: 0px;
    --sidebar-right-w: 0px;
  }

  .sidebar-left,
  .sidebar-right {
    display: none;
  }

  .modes-bar  { padding: 0 10px; }
  .bottom-bar { padding: 0 10px; }

  /* Show hamburger */
  .btn-mobile-menu { display: flex; }

  /* Hide header auth buttons — accessible via hamburger nav */
  .header-auth-btn { display: none !important; }

  /* Drawers: cap width */
  .drawer { width: min(320px, 100vw); }

  /* SEO article */
  .seo-article { padding: 0 16px; margin: 20px auto 32px; }
  .related-tools-grid { grid-template-columns: repeat(2, 1fr); }

  /* Text tool settings: overlay on mobile */
  .tt-settings {
    position: fixed;
    top: calc(var(--header-h) + var(--modes-bar-h));
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 250;
    width: 100%;
    max-height: none;
    display: none;
    border-right: none;
    border-top: 1px solid var(--color-border);
    box-shadow: 0 4px 24px rgba(0,0,0,0.14);
    overflow-y: auto;
  }
  .tt-settings.mobile-open { display: block; }
  .btn-tt-settings-toggle { display: flex; }

  /* ── Tool area: stack panels vertically ── */
  .tool-area {
    flex-direction: column;
    height: auto;
    min-height: calc(100dvh - var(--header-h) - var(--modes-bar-h) - var(--bottom-bar-h));
    overflow-y: auto;
  }
  .panel {
    height: 35vh;
    min-height: 180px;
    border-bottom: 1px solid var(--color-border);
  }

  /* Center control: horizontal strip between panels */
  .panel-center {
    width: 100%;
    height: auto;
    flex-direction: row;
    flex-shrink: 0;
    border-left: none;
    border-right: none;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    padding: 8px 16px;
    justify-content: center;
    gap: 0;
  }
  .center-controls {
    flex-direction: row;
    width: auto;
  }
  .center-select-wrap {
    border-bottom: none;
    border-right: 1px solid #d8d8d8;
  }
  .center-select {
    height: 40px;
    width: 80px;
    font-size: 14px;
  }
  .center-btn {
    height: 40px;
    width: 48px;
    border-top: none;
    border-left: 1px solid rgb(0 0 0 / 0.08);
  }
  .center-btn:first-child { border-left: none; }
  .center-custom-wrap { display: none; }
}

/* ── 540px: small phones ── */
@media (max-width: 540px) {
  .mode-tab {
    padding: 0 8px;
    font-size: 12px;
  }

  .modes-controls {
    display: none;
  }

  .btn-bottom-ghost:not(#btn-convert) span {
    display: none;
  }

  /* Header: tighten on small screens */
  .header-title    { font-size: 13px; }
  .btn-primary-sm  { padding: 5px 10px; font-size: 12px; white-space: nowrap; }
  .btn-ghost-sm    { padding: 5px 8px;  font-size: 12px; white-space: nowrap; }
  .btn-bookmark    { width: 28px; height: 28px; }
  .header-username { font-size: 12px; }
  /* Stop header-right from stretching wider than its content */
  .header-left  { flex: 0 0 auto; }
  .header-right { flex: 0 0 auto; gap: 4px; }

  /* Drawer: full screen */
  .drawer { width: 100vw; border-left: none; }

  /* Shorten "Sign up free" → "Sign up" on small phones */
  .btn-free-text { display: none; }

  /* SEO article */
  .seo-article       { padding: 0 12px; }
  .seo-article h1    { font-size: 1.25rem; }
  .seo-article h2    { font-size: 1rem; }
  .seo-article table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Related tools: 2-up on phone */
  .related-tools-grid { grid-template-columns: 1fr 1fr; }
}


/* ─────────────────────────────────────────────────────────
   TEXT TOOL - layout & settings panel
───────────────────────────────────────────────────────── */

.tt-layout {
  flex: none;
  display: flex;
  overflow: hidden;
  height: calc(100vh - var(--header-h) - var(--modes-bar-h) - var(--bottom-bar-h));
}

/* Settings column */
.tt-settings {
  width: 320px;
  flex-shrink: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  padding: 12px 16px 24px;
}

.tt-settings::-webkit-scrollbar { width: 4px; }
.tt-settings::-webkit-scrollbar-track { background: transparent; }
.tt-settings::-webkit-scrollbar-thumb { background: var(--color-border); border-radius: 2px; }

/* Thin vertical divider between settings and panels */
.tt-col-divider { display: none; }

/* Panels column */
.tt-panels {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.tt-panel-input  { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.tt-panel-output { flex: 1; min-height: 0; display: flex; flex-direction: column; }

.tt-panel-sep {
  height: 1px;
  background: var(--color-border);
  flex-shrink: 0;
}

/* Section visibility */
.tt-section       { display: none; }
.tt-section.active { display: block; }

/* Field rows */
.tt-field-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.tt-field-row--compact { margin-bottom: 6px; }

.tt-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.tt-input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  font-size: 13px;
  color: var(--color-text);
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color 0.12s;
}

.tt-input:focus { border-color: var(--color-primary); outline: none; }
.tt-input--short { flex: 0 0 80px; }
.tt-input--tiny  { flex: 0 0 56px; }

.tt-and {
  font-size: 12px;
  color: var(--color-text-faint);
  white-space: nowrap;
}

/* Checkbox rows */
.tt-check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 8px;
}

.tt-check-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 8px;
  margin-bottom: 8px;
}

.tt-check {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.tt-check input[type="checkbox"] {
  width: 13px;
  height: 13px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}

/* Divider */
.tt-divider {
  height: 1px;
  background: var(--color-border);
  margin: 10px 0;
}

/* Group label */
.tt-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

/* Button groups (case / sort) */
.tt-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}

.tt-case-btn, .tt-sort-btn {
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: color 0.12s, border-color 0.12s, background 0.12s;
  white-space: nowrap;
}

.tt-case-btn:hover, .tt-sort-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.tt-case-btn.active, .tt-sort-btn.active {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.tt-case-btn--clear, .tt-sort-btn--clear {
  border-style: dashed;
}

/* Radio group (linebreak) */
.tt-radio-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tt-radio {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--color-text);
  cursor: pointer;
  user-select: none;
}

.tt-radio--inline {
  flex-wrap: nowrap;
  gap: 6px;
}

.tt-radio input[type="radio"] {
  width: 14px;
  height: 14px;
  accent-color: var(--color-primary);
  flex-shrink: 0;
  cursor: pointer;
}

/* Hint text */
.tt-hint {
  font-size: 11px;
  color: var(--color-text-faint);
  font-style: italic;
  margin-top: 8px;
  line-height: 1.4;
}
