* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f3ef;
  color: #333;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

header {
  position: relative;
  background: #e8e4dd;
  border-bottom: 1px solid #d4d0c8;
  padding: 10px 20px;
}

header h1 {
  font-family: 'SF Mono', Menlo, Monaco, Consolas, 'Courier New', monospace;
  font-size: 36px;
  font-weight: 600;
  font-style: italic;
  text-transform: uppercase;
  color: #4a4540;
}

.header-line0 {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #6b6560;
  padding-bottom: 10px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}

.header-line0 .user-menu { position: static; transform: none; }

.header-title {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: center;
  gap: 2px;
  line-height: 1.1;
  width: fit-content;
  margin: 0 auto;
}

.header-sub {
  font-size: 13px;
  font-weight: 400;
  color: #8a8278;
  letter-spacing: 0.2px;
  text-shadow: none;
}

.header-sub > div:first-child {
  padding-bottom: 5px;
}

.header-sub strong { font-weight: 700; color: #6b6560; }

header .user-menu {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.badge {
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.badge.new { background: #d4edda; color: #155724; }
.badge.stale { background: #fff3cd; color: #856404; }
.badge.none { background: #e2e0dc; color: #6b6560; }

.btn {
  padding: 6px 14px;
  border: 1px solid #c0bbb4;
  border-radius: 6px;
  background: #fff;
  color: #4a4540;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s;
}

.btn:hover { background: #ece9e3; }
.btn.primary { background: #5b7a5e; color: #fff; border-color: #4a6a4d; }
.btn.primary:hover { background: #4a6a4d; }
.btn.danger { color: #c0392b; border-color: #e0b4b0; }
.btn.danger:hover { background: #fdf0ef; }
.btn.sm { padding: 3px 8px; font-size: 12px; }

.btn.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}
.btn.icon-btn .icon-refresh { display: inline-block; line-height: 1; }
.btn.icon-btn.loading .icon-refresh { animation: spin 0.9s linear infinite; }

/* Main content */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

/* Unified search shell */
.search-shell {
  position: relative;
  padding: 8px 20px 10px;
  background: #f0ede8;
  border-bottom: 1px solid #e0ddd6;
}

.refresh-strip {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-bottom: 6px;
  padding: 0 4px;
  font-size: 12px;
  color: #6b6560;
}

.refresh-strip #statusText {
  white-space: nowrap;
  letter-spacing: 0.2px;
}

.refresh-strip .btn.icon-btn {
  width: 56px;
  height: 56px;
  font-size: 26px;
  border-radius: 12px;
}

.refresh-strip .badge {
  padding: 2px 8px;
  font-size: 10.5px;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.search-bar input {
  flex: 1;
  height: 180px;
  padding: 114px 200px 16px 24px;
  border: 1px solid #c0bbb4;
  border-radius: 12px;
  font-size: 42px;
  text-align: center;
  background: #fff;
  outline: none;
  transition: border-color 0.1s, box-shadow 0.1s;
}

.search-bar input::placeholder {
  font-size: 32px;
  color: #b5ada3;
}

.search-bar input:focus {
  border-color: #5b7a5e;
  box-shadow: 0 0 0 3px rgba(91, 122, 94, 0.15);
}

.save-as-row {
  position: absolute;
  right: 12px;
  bottom: 8px;
  display: flex;
  gap: 6px;
  z-index: 5;
}

.save-as {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  font-size: 26px;
  border: 1px solid #c0bbb4;
  background: #fff;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.1s, background 0.15s, border-color 0.15s;
}

.save-as:hover:not(:disabled) { background: #f5f3ef; border-color: #9a9288; }
.save-as:active:not(:disabled) { transform: scale(0.95); }
.save-as:disabled { opacity: 0.4; cursor: not-allowed; }

.save-as.advocate:hover:not(:disabled) { border-color: #3a5a8c; }
.save-as.group:hover:not(:disabled) { border-color: #7a5e5b; }
.save-as.text:hover:not(:disabled) { border-color: #5b7a5e; }

.save-as-compact {
  position: absolute;
  right: 12px;
  bottom: 8px;
  z-index: 5;
}
.save-as-menu-btn {
  width: 38px; height: 38px; font-size: 18px;
  border: 1px solid #c0bbb4; border-radius: 8px; background: #fff; cursor: pointer;
}
.save-as-menu-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.save-as-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(74, 69, 64, 0.12);
  padding: 4px;
  z-index: 40;
  min-width: 150px;
}

.save-as-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 13px;
  color: #4a4540;
}
.save-as-menu-item:hover { background: #f0ede8; }

/* Autosuggest */
.autosuggest {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  margin-top: 4px;
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 8px;
  box-shadow: 0 6px 24px rgba(74, 69, 64, 0.15);
  z-index: 30;
  max-height: 320px;
  overflow-y: auto;
}

.suggestion-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  cursor: pointer;
  border-bottom: 1px solid #f5f3ef;
  font-size: 13px;
}
.suggestion-row:last-child { border-bottom: none; }
.suggestion-row:hover { background: #f5f3ef; }

.suggestion-icon {
  display: inline-flex;
  width: 24px;
  justify-content: center;
  font-size: 16px;
}

.suggestion-name { flex: 1; color: #4a4540; font-weight: 500; }

.suggestion-pinned { color: #d4a017; font-size: 13px; }

.suggestion-pin {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #bbb;
  padding: 2px 6px;
  border-radius: 4px;
}
.suggestion-pin:hover { color: #d4a017; background: #f9f5e8; }

.suggestion-empty {
  padding: 14px;
  font-size: 12px;
  color: #999;
  text-align: center;
}

/* Pinned row — horizontal row anchored to the top of the search bar */
.pinned-row {
  position: absolute;
  left: 12px;
  top: 8px;
  right: 12px;
  z-index: 5;
  display: block;
}

.pinned-scroll {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  overflow-y: hidden;
  flex-wrap: nowrap;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.pinned-scroll::-webkit-scrollbar { display: none; }

.pinned-scroll > .chip { flex: 0 0 auto; }

.pinned-row::before,
.pinned-row::after {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 22px;
  display: none;
  align-items: center;
  font-size: 14px;
  color: #5b7a5e;
  pointer-events: none;
  z-index: 6;
}
.pinned-row::before {
  content: '\25C2';
  left: 0;
  padding-left: 2px;
  justify-content: flex-start;
  background: linear-gradient(to right, rgba(255,255,255,1) 0%, rgba(255,255,255,0.92) 50%, rgba(255,255,255,0) 100%);
}
.pinned-row::after {
  content: '\25B8';
  right: 0;
  padding-right: 2px;
  justify-content: flex-end;
  background: linear-gradient(to left, rgba(255,255,255,1) 0%, rgba(255,255,255,0.92) 50%, rgba(255,255,255,0) 100%);
}
.pinned-row.has-overflow-left::before { display: flex; }
.pinned-row.has-overflow-right::after { display: flex; }

.pinned-row:empty,
.pinned-row .pinned-empty {
  display: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 6px 7px 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: #fff;
  font-size: 13px;
  font-weight: 500;
  color: #4a4540;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s, background 0.15s;
  position: relative;
  user-select: none;
}
.chip:hover { box-shadow: 0 2px 8px rgba(74, 69, 64, 0.12); }
.chip:active { transform: scale(0.97); }

.chip-advocate { background: #eaf0f8; border-color: #c5d3e8; color: #26456b; }
.chip-group    { background: #f5ebe8; border-color: #e5cfc9; color: #6b3e38; }
.chip-text     { background: #e8f0e8; border-color: #c5d8c5; color: #2a4a2c; }

.chip-icon { font-size: 16px; line-height: 1; }

.chip-name {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-name-initials { display: none; }

.chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #2e7d32;
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

.chip-menu,
.chip-unpin {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
}
.chip-menu { color: #6b6560; }
.chip-menu:hover { background: rgba(0, 0, 0, 0.08); color: #4a4540; }
.chip-unpin { color: #999; }
.chip-unpin:hover { background: rgba(192, 57, 43, 0.15); color: #c0392b; }

.chip.dragging { opacity: 0.45; }
.chip.drag-over { box-shadow: inset 2px 0 0 #5b7a5e; }

/* Chip popover */
.chip-popover {
  position: absolute;
  z-index: 60;
  min-width: 280px;
  max-width: 360px;
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 10px;
  box-shadow: 0 10px 32px rgba(74, 69, 64, 0.18);
  padding: 10px 12px;
  font-size: 13px;
}

.popover-title {
  font-weight: 600;
  color: #4a4540;
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px solid #ece9e3;
}

.popover-list { max-height: 200px; overflow-y: auto; }

.popover-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  color: #4a4540;
  gap: 8px;
}

.popover-empty {
  font-size: 12px;
  color: #999;
  font-style: italic;
  padding: 4px 0;
}

.popover-add-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #ece9e3;
}

.popover-add-row input {
  flex: 1;
  padding: 5px 10px;
  border: 1px solid #c0bbb4;
  border-radius: 6px;
  font-size: 12px;
}

/* Main header */
.main-header {
  padding: 10px 20px;
  border-bottom: 1px solid #e0ddd6;
  background: #f0ede8;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-height: 0;
}

.main-header:empty,
.main-header:has(.scope-indicator:not(.active)) {
  display: none;
}

.scope-indicator {
  margin-left: 4px;
  padding: 3px 10px;
  font-size: 12px;
  color: #3a5a8c;
  background: #e8eef7;
  border: 1px solid #c5d3e8;
  border-radius: 12px;
  display: none;
}

.scope-indicator.active { display: inline-flex; align-items: center; gap: 6px; }

.scope-indicator .clear-scope {
  background: none;
  border: none;
  cursor: pointer;
  color: #3a5a8c;
  font-size: 12px;
  padding: 0 2px;
}

.results-area {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  min-height: 0;
}

.empty-state {
  text-align: center;
  color: #999;
  padding: 60px 20px;
  font-size: 14px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #999;
}

.bench-group { margin-bottom: 24px; }

.bench-label {
  background: #3a5a8c;
  color: #fff;
  display: inline-block;
  padding: 7px 18px;
  border-radius: 6px;
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}

.hearing-date-label {
  background: #5b7a5e;
  color: #fff;
  display: inline-block;
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  margin-left: 8px;
}

.result-count {
  margin-bottom: 12px;
  color: #6b6560;
  font-size: 13px;
}

/* Results table */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  margin-bottom: 16px;
  border: 1px solid #d4d0c8;
  border-radius: 8px;
  background: #fff;
}

.results-table {
  table-layout: fixed;
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  background: #fff;
}

.results-table col.col-sl    { width: 52px; }
.results-table col.col-case  { width: 150px; }
.results-table col.col-party { width: 45%; }

.results-table thead th { background: #e8e4dd; }

.results-table th {
  padding: 8px 12px;
  text-align: left;
  font-weight: 600;
  color: #4a4540;
  font-size: 12px;
  text-transform: uppercase;
  border-bottom: 2px solid #d4d0c8;
  overflow: hidden;
  text-overflow: ellipsis;
}

.results-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #ece9e3;
  vertical-align: top;
  overflow: hidden;
  background: #fff;
}

.results-table tr:last-child td { border-bottom: none; }
.results-table tbody tr:hover td { background: #faf8f5; }

/* Pinned serial-number and case-no columns: stay visible while parties scroll */
.results-table th:first-child,
.results-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  text-align: center;
  white-space: nowrap;
  padding: 4px 6px;
}
.results-table thead th:first-child { z-index: 3; }

.results-table th:nth-child(2),
.results-table td.case-no-cell {
  position: sticky;
  left: 52px;
  z-index: 2;
  box-shadow: 1px 0 0 #ece9e3;
  padding: 4px 6px;
}
.results-table thead th:nth-child(2) { z-index: 3; box-shadow: 1px 0 0 #d4d0c8; }

.results-table td:first-child .cell-scroll { white-space: nowrap; }

.cell-scroll {
  position: relative;
  max-height: 125px;
  overflow-y: auto;
  padding-right: 6px;
  line-height: 1.4;
  word-break: break-word;
}

.cell-scroll pre {
  font-family: inherit;
  font-size: 12px;
  white-space: pre-wrap;
  margin: 0;
  line-height: 1.4;
}

.cell-scroll.has-overflow::after {
  content: '▼';
  position: sticky;
  bottom: 0;
  display: block;
  text-align: center;
  font-size: 10px;
  color: #5b7a5e;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, rgba(255,255,255,0.92) 50%, rgba(255,255,255,1) 100%);
  margin-top: -14px;
  padding-top: 6px;
  pointer-events: none;
}

.case-no-cell .case-no {
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.case-no-cell .case-meta {
  font-size: 11px;
  color: #7a7570;
  margin-top: 3px;
  line-height: 1.3;
  word-break: break-word;
}

.history-group { margin-bottom: 20px; }

.history-group h3 {
  font-size: 14px;
  color: #4a4540;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 2px solid #5b7a5e;
}

/* Historical (past hearing) results appended below live results */
.history-section {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 2px dashed #c0bbb4;
  opacity: 0.65;
  filter: grayscale(0.35);
}

.history-section:hover { opacity: 0.85; }

.history-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #6b6560;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 12px;
}

.history-section .bench-label {
  background: #7a7570;
}

.history-section .hearing-date-label {
  background: #8a8278;
}

.history-date-divider {
  font-size: 13px;
  font-weight: 600;
  color: #6b6560;
  margin: 14px 0 8px;
  padding: 4px 10px;
  background: #ece9e3;
  border-radius: 4px;
  display: inline-block;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 18px;
  background: #333;
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 100;
}
.toast.show { opacity: 1; }

/* Loading overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(245, 243, 239, 0.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  z-index: 1000;
  backdrop-filter: blur(2px);
  transition: opacity 0.25s;
}
.loading-overlay.hidden { opacity: 0; pointer-events: none; }

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #d4d0c8;
  border-top-color: #5b7a5e;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.loading-text { color: #4a4540; font-size: 14px; font-weight: 500; }

/* Login page */
.login-body {
  background: #e8e4dd;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card {
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 12px;
  padding: 36px 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 8px 32px rgba(74, 69, 64, 0.12);
  text-align: center;
}

.login-card h1 { font-size: 22px; font-weight: 700; color: #4a4540; margin-bottom: 4px; }
.login-sub { color: #8a8278; font-size: 13px; margin-bottom: 24px; }
.login-instruction { color: #6b6560; font-size: 14px; margin-bottom: 20px; }

.provider-buttons { display: flex; flex-direction: column; gap: 10px; }

.provider-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid #c0bbb4;
  border-radius: 8px;
  background: #fff;
  color: #4a4540;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.provider-btn:hover { background: #f5f3ef; border-color: #9a9288; }

.provider-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-weight: 700;
  font-size: 14px;
  border-radius: 4px;
}

.provider-google .provider-icon { background: #4285f4; color: #fff; }
.provider-github .provider-icon { background: #24292e; color: #fff; }
.provider-microsoft .provider-icon { background: #0078d4; color: #fff; }

.login-empty {
  padding: 16px;
  background: #fdf0ef;
  border: 1px solid #e0b4b0;
  border-radius: 8px;
  color: #8a3a33;
  font-size: 13px;
  text-align: left;
}

.login-empty code {
  background: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  font-family: 'SF Mono', monospace;
  font-size: 12px;
}

/* User menu */
.user-menu { position: relative; }

.user-menu-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  font-size: 14px;
  background: #fff;
  border: 1px solid #c0bbb4;
  border-radius: 24px;
  cursor: pointer;
  font-size: 13px;
  color: #4a4540;
}

.user-menu-toggle:hover { background: #f5f3ef; }

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.user-name {
  font-weight: 500;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-caret { font-size: 10px; color: #999; }

.user-menu-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 160px;
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(74, 69, 64, 0.12);
  padding: 4px;
  z-index: 50;
}

.user-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 8px 12px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 5px;
  font-size: 13px;
  color: #4a4540;
}

.user-menu-item:hover { background: #f0ede8; }
.user-menu-item.danger { color: #c0392b; }
.user-menu-item.danger:hover { background: #fdf0ef; }
.user-menu-logout { margin: 0; }

/* Preferences modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(74, 69, 64, 0.35);
  backdrop-filter: blur(2px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 500;
}

.modal-backdrop[hidden] { display: none; }

.modal {
  background: #fff;
  border: 1px solid #d4d0c8;
  border-radius: 12px;
  width: 460px;
  max-width: 92vw;
  box-shadow: 0 12px 40px rgba(74, 69, 64, 0.2);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid #ece9e3;
}

.modal-header h2 { font-size: 16px; font-weight: 600; color: #4a4540; }

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  color: #8a8278;
  padding: 4px 8px;
  border-radius: 4px;
}

.modal-close:hover { background: #f0ede8; color: #4a4540; }

.modal-body { padding: 16px 20px 20px; }

.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 13px;
  color: #4a4540;
  border-bottom: 1px solid #f5f3ef;
}

.pref-row:last-child { border-bottom: none; }

.pref-row select,
.pref-row input[type="number"] {
  padding: 4px 10px;
  border: 1px solid #c0bbb4;
  border-radius: 6px;
  background: #fff;
  font-size: 13px;
  min-width: 120px;
}

.pref-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: #5b7a5e; }

/* Footer */
.app-footer {
  padding: 10px 20px;
  background: #e8e4dd;
  border-top: 1px solid #d4d0c8;
  text-align: center;
  font-size: 12px;
  color: #6b6560;
}

/* Touch devices: fat-finger sizing for chip controls */
@media (pointer: coarse) {
  .chip { padding: 10px 8px 10px 14px; font-size: 14px; }
  .chip-icon { font-size: 18px; }
  .chip-menu,
  .chip-unpin { width: 32px; height: 32px; font-size: 18px; }
  .chip-name { max-width: 160px; }
}

/* Responsive */
@media (max-width: 900px) {
  header { padding: 10px 14px; }
  .search-bar input { height: 165px; font-size: 36px; padding: 105px 160px 14px 20px; }
  .search-bar input::placeholder { font-size: 26px; }
  .save-as { width: 44px; height: 44px; font-size: 20px; }
  .refresh-strip .btn.icon-btn { width: 44px; height: 44px; font-size: 22px; border-radius: 10px; }
  .chip-name { max-width: 130px; }
}

@media (max-width: 700px) {
  header { padding: 8px 12px; }
  header .user-menu { right: 10px; }
  .user-menu-toggle { padding: 2px 8px 2px 3px; font-size: 11px; gap: 4px; }
  .user-avatar { width: 22px; height: 22px; }
  .user-name { max-width: 70px; font-size: 11px; }
  .user-caret { font-size: 9px; }
  header h1 { font-size: 15px; }
  .header-sub { font-size: 9.5px; }
  .search-shell { padding: 6px 14px 8px; }
  .search-bar input { height: 135px; font-size: 30px; border-radius: 10px; padding: 88px 60px 12px 16px; }
  .search-bar input::placeholder { font-size: 20px; }
  .save-as-row { display: none; }
  .save-as-compact { display: block; }
  .save-as-menu-btn { width: 38px; height: 38px; font-size: 20px; border-radius: 8px; }
  .results-area { padding: 12px 14px; }
  .main-header { padding: 8px 14px; }
  .refresh-strip { font-size: 10.5px; gap: 6px; }
  .refresh-strip .btn.icon-btn { width: 38px; height: 38px; font-size: 20px; border-radius: 8px; }
  .refresh-strip .badge { padding: 1px 6px; font-size: 9.5px; }
  .save-as-row { right: 8px; bottom: 6px; }
  .save-as-compact { right: 8px; bottom: 6px; }
  .pinned-row { left: 8px; right: 8px; gap: 4px; top: 6px; }
  .chip { padding: 5px 5px 5px 8px; gap: 4px; }
  .chip-icon { font-size: 16px; }
  .chip-name-full { display: none; }
  .chip-name-initials { display: inline; font-weight: 700; letter-spacing: 0.5px; font-size: 13px; }
  .chip-name { max-width: 60px; }
  .chip-menu, .chip-unpin { width: 20px; height: 20px; font-size: 13px; }
  .chip-count { min-width: 14px; height: 14px; font-size: 9px; padding: 0 3px; }
}

@media (max-width: 500px) {
  .refresh-strip { font-size: 9.5px; }
  .user-name { display: none; }
  .user-menu-toggle { padding: 2px; }
  .user-caret { display: none; }
  .user-avatar { width: 24px; height: 24px; }
  .search-bar input { height: 114px; font-size: 24px; padding: 76px 50px 10px 14px; }
  .search-bar input::placeholder { font-size: 16px; }
  .save-as-menu-btn { width: 34px; height: 34px; font-size: 18px; }
  .refresh-strip .btn.icon-btn { width: 34px; height: 34px; font-size: 18px; }
}
