#ws-wordshift *, #ws-wordshift *::before, #ws-wordshift *::after { box-sizing: border-box; }

/* Impreza form-control reset -- neutralises theme option styles on inputs and buttons.
   :where() keeps specificity at the ID only, so prefixed component rules below always win. */
#ws-wordshift :where(button, input, select, textarea) {
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
  font-family: var(--f-ui);
  color: inherit;
  letter-spacing: normal;
  text-transform: none;
  background: none;
  border: none;
  border-radius: 0;
  box-shadow: none;
  height: auto;
  min-height: 0;
  line-height: inherit;
  margin: 0;
  padding: 0;
}
#ws-wordshift :where(button) { cursor: pointer; }

#ws-wordshift :where(button, input, select, textarea):focus,
#ws-wordshift :where(button, input, select, textarea):focus-visible {
  outline: none;
  box-shadow: none;
}

#ws-wordshift {
  --bg:         #F9F6F1;
  --surface:    #FFFFFF;
  --text-1:     #1C1917;
  --text-2:     #2C2926;
  --text-muted: #78716C;
  --accent:     #B45309;
  --accent-dk:  #92400E;
  --border:     #E7E5E4;
  --sg-blue:    #6B8EB5;
  --sg-amber:   #B8946A;
  --sg-green:   #6A9E7F;
  --line-blue:  #2E5FA3;
  --line-amber: #A0621E;
  --line-green: #2E7D52;
  --f-wm:  'Bitter', Georgia, serif;
  --f-disp:'Playfair Display', Georgia, serif;
  --f-body:'Source Serif 4', Georgia, serif;
  --f-ui:  'DM Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--f-ui);
  font-size: 18px;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 600px;
  position: relative;
  width: 100%;
  max-width: 100%;
}

/* â”€â”€ Layout â”€â”€ */
.app {
  display: flex;
  width: 100%;
  min-height: 500px;
}

/* Sidebar */
.sidebar {
  width: 300px;
  background: var(--bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-x: clip;
  flex-shrink: 0;
  padding: 0;
  transition: width 0.22s ease, opacity 0.18s ease;
}

.sidebar.collapsed {
  width: 0;
  opacity: 0;
  overflow: hidden;
  border-right: none;
  min-width: 0;
}

/* Main panel */
.main {
  background: var(--surface);
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  position: relative;
  overflow: visible;
}

/* Sidebar toggle button -- sits on the border between sidebar and main */
.daily-card {
  padding: 16px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  box-sizing: border-box;
  transition: max-height 0.25s ease;
}
.daily-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0;
  padding: 2px 0;
}
.daily-card-body {
  overflow: hidden;
}

.sidebar-inner {
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: sticky;
  top: 0;
  max-height: 100vh;
  overflow-y: auto;
}



/* Persistent main-panel toggle -- always visible top left of main area */
/* Boundary handle -- straddles the sidebar/main border, viewport-centred */
.main-toggle-rail {
  position: sticky;
  top: 0;
  height: 0;
  z-index: 40;
}
#ws-wordshift .main-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 48px;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 0;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
  position: absolute;
  left: -13px;
  top: calc(50vh - 24px);
}
#ws-wordshift .main-toggle:hover { color: var(--text-1); border-color: var(--text-muted); }
/* When the panel is closed the main edge meets the window, so bring the handle inside */
#ws-wordshift .sidebar.collapsed + .main .main-toggle { left: 0; }


/* Accordion */
.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding: 2px 0;
  user-select: none;
}
.accordion-header:hover .surprise-btn {
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 8px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: 12px;
}
.surprise-btn:hover { color: var(--text-1); border-color: var(--text-muted); }

.sidebar-section-label { color: var(--accent); }

.accordion-chevron {
  color: var(--text-muted);
  transition: transform 0.2s ease;
  flex-shrink: 0;
}
.accordion-chevron.open { transform: rotate(180deg); }

.accordion-body {
  overflow: hidden;
  transition: max-height 0.25s ease, opacity 0.2s ease;
  max-height: 0;
  opacity: 0;
}
.accordion-body.open {
  max-height: 1200px;
  opacity: 1;
  padding-top: 8px;
}

/* Options blocks */
.option-block {
  margin-bottom: 18px;
}
.option-block:last-child { margin-bottom: 0; }

.option-label {
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  margin-bottom: 8px;
}

.option-note {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.4;
}

.option-toggle {
  display: flex;
  border: 1px solid var(--border);
  width: fit-content;
}

#ws-wordshift .opt-btn {
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border: none;
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  border-right: 1px solid var(--border);
  min-height: 38px;
  border-radius: 0;
}
#ws-wordshift .opt-btn:last-child { border-right: none; }
#ws-wordshift .opt-btn.active { background: var(--text-1); color: var(--bg); }
#ws-wordshift .opt-btn:not(.active):hover { color: var(--text-1); }

.option-range {
  display: flex;
  align-items: center;
  gap: 8px;
}

#ws-wordshift .range-input {
  font-family: var(--f-ui);
  font-size: 16px;
  font-weight: 400;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 10px;
  width: 78px;
  outline: none;
  transition: border-color 0.15s;
  border-radius: 0;
  appearance: none;
  -moz-appearance: textfield;
}
#ws-wordshift .range-input:focus { border-color: var(--accent); }
#ws-wordshift .range-input::-webkit-inner-spin-button,
#ws-wordshift .range-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.range-sep {
  font-family: var(--f-ui);
  font-size: 13px;
  color: var(--text-muted);
}

.surprise-btn {
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: 1px solid var(--border);
  padding: 8px 14px;
  cursor: pointer;
  width: 100%;
  text-align: left;
  transition: color 0.15s, border-color 0.15s;
  margin-bottom: 12px;
}
.surprise-btn:hover { color: var(--text-1); border-color: var(--text-muted); }

.sidebar-section-label {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0;
}

/* Category rows -- full tap targets */
.section-label {
  font-family: var(--f-ui);
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 32px 16px 12px;
  display: block;
}

.cat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  min-height: 48px;
  padding: 0 16px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s ease-out;
}
.cat-row:hover { background: rgba(28,25,23,0.03); }
.cat-row-last { border-bottom: 1px solid var(--border); }
.cat-row-label {
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-1);
}
.cat-chevron {
  color: var(--text-muted);
  transition: transform 260ms cubic-bezier(0.22,1,0.36,1);
  flex-shrink: 0;
}
.cat-chevron.open { transform: rotate(180deg); }

/* Accordion animation using grid trick */
.acc-grid-wrap {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 260ms cubic-bezier(0.22,1,0.36,1);
}
.acc-grid-wrap.open { grid-template-rows: 1fr; }
.acc-grid-inner {
  overflow: hidden;
  opacity: 0;
  transition: opacity 180ms ease-out 80ms;
}
.acc-grid-wrap.open .acc-grid-inner { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .acc-grid-wrap { transition: none; }
  .acc-grid-inner { transition: opacity 120ms ease-out; }
  .cat-chevron { transition: none; }
}

/* Section headers (OPTIONS, EXPLORE BY THEME) */
/* section-header removed -- using section-label */

/* Pill redesign -- chip scale */
.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 16px 16px;
}
#ws-wordshift .pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 400;
  color: var(--text-2);
  background: transparent;
  border: 1px solid var(--border);
  padding: 4px 9px;
  border-radius: 3px;
  cursor: pointer;
  transition: color 0.12s ease-out, border-color 0.12s ease-out;
  line-height: 1.4;
  white-space: nowrap;
}
#ws-wordshift .pill:hover { color: var(--text-1); border-color: var(--text-muted); }



/* Options inner padding */
.options-inner {
  padding: 12px 16px 4px;
}

.cat-label {
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
  font-size: 13px;
}

/* Daily word */
.daily-word-display {
  font-family: var(--f-disp);
  font-size: 28px;
  overflow-wrap: break-word;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.1;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: color 0.15s;
}
.daily-word-display:hover { color: var(--accent); }

.daily-teaser {
  font-family: var(--f-body);
  font-size: 14px;
  font-weight: 300;
  color: var(--text-2);
  line-height: 1.6;
  margin-top: 6px;
}

/* Search inputs */
.search-group {
  display: flex;
  flex-direction: column;
  gap: 0;
  align-items: flex-start;
}

.search-hint {
  font-family: var(--f-ui);
  font-size: 14px;
  font-weight: 400;
  color: var(--text-2);
  margin-bottom: 12px;
}

.colour-pip {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

#ws-wordshift .ws-input {
  font-family: var(--f-ui);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-1);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 2px;
  padding: 8px 36px 8px 8px;
  width: 140px;
  min-width: 140px;
  max-width: 320px;
  height: 44px;
  outline: none;
  transition: border-color 0.15s;
  appearance: none;
  box-sizing: border-box;
  overflow: hidden;
}
.ws-measure {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  font-family: var(--f-ui);
  font-size: 16px;
  font-weight: 500;
  padding: 8px 36px 8px 8px;
  pointer-events: none;
  top: -9999px;
  left: -9999px;
}
#ws-wordshift .ws-input::placeholder { color: var(--text-muted); font-size: 16px; font-weight: 400; }
#ws-wordshift .ws-input:focus {
  border-color: var(--accent);
  outline: none;
}

.add-word-btn {
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 500;
  color: var(--text-muted);
  background: transparent;
  border: none;
  padding: 12px 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  transition: color 0.15s;
  margin-bottom: 12px;
}
.add-word-btn:hover { color: var(--accent); }
.add-word-btn svg { flex-shrink: 0; }

/* Input clear and remove buttons */
.input-wrap {
  position: relative;
  position: relative;
  flex: 1;
  display: flex;
  align-items: center;
}
#ws-wordshift .input-clear {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  display: none;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0;
  transition: color 0.15s;
}
#ws-wordshift .input-clear:hover { color: var(--text-1); }
#ws-wordshift .input-clear.visible { display: flex; }

.search-btn {
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 9px 24px;
  cursor: pointer;
  transition: background 0.15s;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  border-radius: 0;
  width: auto;
  margin-top: 8px;
}
.search-btn:hover { background: var(--accent-dk); border-color: var(--accent-dk); }

/* Suggestion categories */
.explore-group-header {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 4px 0 2px;
  border-top: 1px solid var(--border);
  margin-top: 2px;
}

/* old pill CSS removed */

/* Methodology */
.methodology {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* â”€â”€ Main panel â”€â”€ */
/* .main consolidated above */

.chart-header {
  padding: 24px 28px 12px;
}

.chart-title {
  font-family: var(--f-disp);
  font-size: 26px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 2px;
}

.data-info {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 28px 8px;
  line-height: 1.5;
  text-align: right;
}

.chart-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 28px;
  gap: 8px;
}

/* Toggle */
#ws-wordshift .ws-toggle {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  height: 36px;
  overflow: hidden;
}
#ws-wordshift .ws-toggle > .toggle-btn {
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 500;
  padding: 0 14px;
  margin: 0;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
  border-radius: 0;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}
#ws-wordshift .ws-toggle > .toggle-btn:last-child { border-right: none; }
#ws-wordshift .ws-toggle > .toggle-btn.active { background: var(--text-1); color: var(--bg); }
#ws-wordshift .ws-toggle > .toggle-btn:not(.active):hover { color: var(--text-1); }

/* Action buttons */
.chart-actions { display: flex; align-items: center; gap: 8px; position: relative; flex-shrink: 0; }

.btn-ghost {
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  transition: color 0.15s;
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
}
.btn-ghost:hover { color: var(--accent-dk); }

#ws-wordshift .btn-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.15s;
  border-radius: 0;
  position: relative;
}
#ws-wordshift .btn-icon:hover { border-color: var(--text-2); color: var(--text-1); }
#ws-wordshift .btn-icon.active { border-color: var(--accent); color: var(--accent); }

/* Export dropdown */
.export-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  width: 180px;
  z-index: 200;
  display: none;
  flex-direction: column;
}
.export-dropdown.open { display: flex; }

#ws-wordshift .export-item {
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-1);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.1s;
  min-height: 48px;
  width: 100%;
}
#ws-wordshift .export-item:last-child { border-bottom: none; }
#ws-wordshift .export-item:hover:not(.locked) { background: var(--bg); }
#ws-wordshift .export-item.locked { color: var(--text-muted); cursor: default; }

.export-item-label { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.export-badge {
  font-family: var(--f-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 2px 5px;
  line-height: 1.4;
  opacity: 0.8;
}

.export-badge-free {
  font-family: var(--f-ui);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  border: 1px solid var(--border);
  padding: 2px 5px;
  line-height: 1.4;
}

/* Share panel */
.share-panel {
  position: absolute;
  top: calc(100% + 6px);
  right: 44px;
  background: var(--surface);
  border: 1px solid var(--border);
  width: 180px;
  z-index: 200;
  display: none;
  flex-direction: column;
}
.share-panel.open { display: flex; }

.share-panel-header {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 10px 14px 8px;
  border-bottom: 1px solid var(--border);
}

#ws-wordshift .share-item {
  font-family: var(--f-ui);
  font-size: 15px;
  color: var(--text-1);
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 13px 14px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: background 0.1s;
  min-height: 48px;
  width: 100%;
}
#ws-wordshift .share-item:last-child { border-bottom: none; }
#ws-wordshift .share-item:hover:not(.locked) { background: var(--bg); }
#ws-wordshift .share-item.locked { color: var(--text-muted); cursor: default; }

.share-embed-code {
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--text-2);
  background: var(--bg);
  border-top: 1px solid var(--border);
  padding: 10px 14px;
  line-height: 1.5;
  word-break: break-all;
  display: none;
}
.share-embed-code.visible { display: block; }

.share-credit {
  font-family: var(--f-ui);
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 14px;
  border-top: 1px solid var(--border);
  line-height: 1.4;
}

/* Overlay to close panels */
.panel-overlay {
  position: fixed;
  inset: 0;
  z-index: 190;
  display: none;
}
.panel-overlay.active { display: block; }

/* Legend */
.chart-legend {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}
.legend-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--f-ui);
  font-size: 12px;
  color: var(--text-muted);
}
.legend-swatch {
  width: 24px;
  height: 3px;
  flex-shrink: 0;
}

/* Chart canvas area */
.chart-canvas-wrap {
  padding: 20px 28px 8px;
  position: relative;
}

#chart-canvas {
  display: block;
  width: 100%;
}

/* Loading state */

/* â”€â”€ Inline search above chart â”€â”€ */
.inline-search {
  padding: 16px 28px 12px;
  background: var(--surface);
  box-sizing: border-box;
  position: sticky;
  top: 0;
  z-index: 50;
  transition: box-shadow 0.15s ease;
}
.inline-search.scrolled {
  box-shadow: 0 1px 3px rgba(28,25,23,0.08);
}

.inline-search-label {
  font-family: var(--f-ui);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

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

.inline-field {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

#ws-wordshift .inline-add-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: 1px solid var(--border);
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s, border-color 0.15s;
  border-radius: 0;
  flex-shrink: 0;
}
#ws-wordshift .inline-add-btn:hover { color: var(--accent); border-color: var(--accent); }

.inline-remove-btn {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  transition: color 0.15s;
  flex-shrink: 0;
}
.inline-remove-btn:hover { color: #991B1B; }

#ws-wordshift .inline-search-btn {
  font-family: var(--f-ui);
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  padding: 8px 20px;
  cursor: pointer;
  transition: background 0.15s;
  min-height: 40px;
  border-radius: 0;
  white-space: nowrap;
  flex-shrink: 0;
}
#ws-wordshift .inline-search-btn:hover { background: var(--accent-dk); border-color: var(--accent-dk); }


/* Toast message */
.ws-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--text-1);
  color: var(--bg);
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 999;
  white-space: nowrap;
}
.ws-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.chart-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 390px;
  font-family: var(--f-ui);
  font-size: 14px;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* â”€â”€ Moments panel â”€â”€ */
#ws-wordshift .inflection-section {
  padding: 12px 28px 24px;
}
#ws-wordshift .moments-label {
  font-family: var(--f-ui);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}
#ws-wordshift .moments-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 22px 24px 24px;
}
#ws-wordshift .moments-panel.empty {
  color: var(--text-muted);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
}
#ws-wordshift .mom-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
#ws-wordshift .mom-head-left { display: flex; align-items: baseline; gap: 10px; }
#ws-wordshift .mom-year { font-family: var(--f-body); font-weight: 700; font-size: 32px; line-height: 1; }
#ws-wordshift .mom-word { font-family: var(--f-ui); font-size: 20px; }
#ws-wordshift .mom-label {
  font-family: var(--f-ui);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}
#ws-wordshift .mom-controls { display: flex; align-items: center; gap: 4px; }
#ws-wordshift .mom-icon {
  width: 44px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: 0; font-size: 13px; line-height: 1;
  transition: color 0.15s;
}
#ws-wordshift .mom-icon:hover { color: var(--text-1); }
#ws-wordshift .mom-icon[disabled] { opacity: .3; cursor: default; }
#ws-wordshift .mom-icon svg { width: 16px; height: 16px; }
#ws-wordshift .mom-sel { display: flex; align-items: center; }
#ws-wordshift .mom-seldot {
  width: 34px; height: 44px;
  display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer; padding: 0; font-size: 0;
}
#ws-wordshift .mom-seldot[disabled] { cursor: default; }
#ws-wordshift .mom-seldot i { width: 11px; height: 11px; border-radius: 50%; display: block; transition: box-shadow .12s, opacity .12s; }
#ws-wordshift .mom-cols { display: grid; grid-template-columns: 2fr 1fr; gap: 24px; }
#ws-wordshift .mom-body { font-family: var(--f-body); font-size: 16px; line-height: 1.6; margin: 6px 0 0; max-width: 62ch; }
#ws-wordshift .mom-src-work { font-family: var(--f-body); font-style: italic; font-size: 14px; line-height: 1.5; color: #57534E; display: block; margin-top: 6px; }
#ws-wordshift .mom-src-detail { font-family: var(--f-body); font-size: 14px; line-height: 1.5; color: var(--text-muted); display: block; }
#ws-wordshift .mom-src-fallback { font-family: var(--f-body); font-size: 14px; line-height: 1.5; color: var(--text-muted); margin-top: 6px; }
#ws-wordshift .mom-actions { display: flex; gap: 18px; margin-top: 22px; align-items: center; }
#ws-wordshift .mom-rarity {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--f-ui); font-size: 12px; font-weight: 500;
  color: var(--accent-dk); margin-left: auto;
}
#ws-wordshift .mom-rarity svg { width: 13px; height: 13px; flex-shrink: 0; }
#ws-wordshift .mom-def-label { font-family: var(--f-ui); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-muted); }
#ws-wordshift .mom-def-text { font-family: var(--f-body); font-size: 14px; line-height: 1.5; color: var(--text-2); margin-top: 6px; display: block; }
#ws-wordshift .mom-def-pos { font-family: var(--f-ui); font-size: 11px; color: var(--text-muted); font-style: italic; margin-right: 4px; }
#ws-wordshift .mom-act {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; background: none; border: none; cursor: pointer;
  font-family: var(--f-ui); font-size: 13px; color: var(--text-muted);
  padding: 0; line-height: 1; transition: color 0.15s;
}
#ws-wordshift .mom-act:hover { color: var(--text-1); }
#ws-wordshift .mom-act svg { width: 15px; height: 15px; flex-shrink: 0; }
@media (max-width: 560px) {
  #ws-wordshift .mom-cols { grid-template-columns: 1fr; gap: 28px; }
}

/* Notice strips */
.notice {
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-2);
  padding: 9px 14px;
  border-left: 2px solid var(--accent);
  background: var(--bg);
  margin: 0 28px 12px;
  line-height: 1.5;
}

/* Empty state */
.empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 40px;
  text-align: center;
}

.empty-wordmark {
  font-family: var(--f-wm);
  font-size: 48px;
  font-weight: 700;
  color: var(--text-1);
  letter-spacing: -0.02em;
  margin-bottom: 20px;
  text-transform: lowercase;
}

.empty-tagline {
  font-family: var(--f-disp);
  font-size: 32px;
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 56px;
}

.empty-prompt {
  font-family: var(--f-ui);
  font-size: 18px;
  font-weight: 400;
  color: var(--text-2);
  max-width: 560px;
  line-height: 1.65;
}

/* Crossover notice */
.crossover-notice {
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-2);
  padding: 9px 14px;
  border-left: 2px solid var(--sg-blue);
  background: var(--bg);
  margin: 0 28px 12px;
  line-height: 1.5;
}

/* Absence notice */
.absence-notice {
  font-family: var(--f-ui);
  font-size: 15px;
  font-weight: 400;
  color: var(--text-2);
  padding: 9px 14px;
  border-left: 2px solid var(--text-muted);
  background: var(--bg);
  margin: 0 28px 8px;
  line-height: 1.5;
}

/* Responsive */
/* â”€â”€ Mobile layout (768px and below) â”€â”€ */
@media (max-width: 768px) {

  /* Stack layout vertically */
  #ws-wordshift .app { flex-direction: column; }

  /* Sidebar: hidden by default, slides in as overlay */
  #ws-wordshift .sidebar {
    position: fixed;
    top: 0; left: 0;
    width: 85vw;
    max-width: 320px;
    height: 100vh;
    z-index: 200;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    overflow-y: auto;
    border-right: 1px solid var(--border);
    box-shadow: 4px 0 24px rgba(28,25,23,0.15);
  }
  #ws-wordshift .sidebar.mobile-open {
    transform: translateX(0);
  }
  /* Collapsed class has no effect on mobile -- position:fixed handles it */
  #ws-wordshift .sidebar.collapsed {
    width: 85vw;
    max-width: 320px;
    opacity: 1;
    overflow-y: auto;
    border-right: 1px solid var(--border);
  }

  /* Overlay behind open sidebar */
  #ws-wordshift .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(28,25,23,0.4);
    z-index: 199;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
  }
  #ws-wordshift .sidebar-overlay.active { opacity: 1; pointer-events: auto; }
  #ws-wordshift .sidebar input, #ws-wordshift .sidebar button { position: relative; z-index: 201; }

  /* Main panel: full width */
  #ws-wordshift .main { width: 100%; }

  /* Hide the desktop boundary handle */
  #ws-wordshift .main-toggle-rail { display: none; }

  /* Mobile header bar: menu button + word of the day */
  #ws-wordshift .mobile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: relative;
    z-index: 52;
  }
  #ws-wordshift .mobile-menu-btn {
    width: 44px; height: 44px;
    display: flex; align-items: center; justify-content: center;
    background: none; border: 1px solid var(--border);
    cursor: pointer; color: var(--text-2); flex-shrink: 0;
    padding: 0;
  }
  #ws-wordshift .mobile-menu-btn svg { width: 16px; height: 16px; }
  #ws-wordshift .mobile-header-word {
    font-family: var(--f-disp);
    font-size: 24px;
    font-weight: 700;
    color: var(--text-1);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  #ws-wordshift .mobile-header-label {
    font-family: var(--f-ui);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    white-space: nowrap;
  }

  /* Hide the desktop daily card in sidebar on mobile */
  #ws-wordshift .daily-card { display: none; }

  /* Inline search: tighter on mobile */
  #ws-wordshift .inline-search {
    padding: 12px 16px 10px;
    position: relative;
    top: auto;
    left: auto;
    right: auto;
    z-index: 51;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(28,25,23,0.08);
    width: 100%;
    box-sizing: border-box;
  }
  /* Push main content down to account for fixed mobile header + search bar */
  #ws-wordshift .chart-controls { margin-top: 0; }
  #ws-wordshift .inline-search-label { display: none; }
  #ws-wordshift .inline-search-fields { flex-wrap: wrap; gap: 8px; }
  #ws-wordshift .inline-field { width: 100%; }
  #ws-wordshift .inline-field .input-wrap { flex: 1; }
  #ws-wordshift .ws-input { width: 100% !important; max-width: 100% !important; min-width: 0 !important; font-size: 16px; box-sizing: border-box; }
  #ws-wordshift .inline-add-btn { flex-shrink: 0; }
  #ws-wordshift .inline-search-btn { width: 100%; margin-top: 4px; }

  /* Chart controls: wrap toggles */
  #ws-wordshift .chart-controls { padding: 8px 16px; flex-wrap: wrap; gap: 8px; }
  #ws-wordshift .chart-controls > div:first-child { flex-wrap: wrap; gap: 8px; width: 100%; }
  #ws-wordshift .ws-toggle { width: 100%; }
  #ws-wordshift .ws-toggle > .toggle-btn { flex: 1; text-align: center; }

  /* Chart canvas: tighter padding */
  #ws-wordshift .chart-canvas-wrap { padding: 12px 16px 8px; }

  /* Legend and data info: stack */
  #ws-wordshift .inflection-section { padding: 12px 16px 20px; }
  #ws-wordshift .mom-cols { grid-template-columns: 1fr; gap: 20px; }

  /* Data info: full width below legend */
  #ws-wordshift .data-info { padding: 4px 16px 8px; text-align: left; }

  /* Chart controls: share/download icons inline with toggles on same row */
  #ws-wordshift .chart-controls { padding: 8px 16px; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
  #ws-wordshift .chart-controls > div:first-child { flex-wrap: wrap; gap: 6px; flex: 1; }
  #ws-wordshift .chart-actions { flex-shrink: 0; }

  /* Chart canvas: keep small side padding on mobile */
  #ws-wordshift .chart-canvas-wrap { padding: 12px 8px 8px; }

  /* Sidebar overlay: ensure it covers full screen width */
  #ws-wordshift .sidebar-overlay { width: 100vw; }


  /* Legend and info row: stack on mobile */
  #ws-wordshift .chart-legend-row {
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 6px 16px 8px !important;
    gap: 4px !important;
  }
  #ws-wordshift .data-info { text-align: left !important; margin-left: 0 !important; }
}