:root {
  --bg: #16233d;
  --surface: #1c2e4f;
  --surface-2: #24395f;
  --sidebar-bg: #0b1424;
  --border: #2f4772;
  --text: #eef1f8;
  --text-muted: #9aabc9;
  --accent: #4f8fff;
  --accent-hover: #3b76e0;
  --danger: #ef4444;
  --danger-bg: #2a1418;
  --success: #22c55e;
  --radius: 10px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  transition: background 0.2s;
}

/* Materials context — same layout, a visibly different purple-leaning
   tint so it's obvious you're not in the LED side of the portal. */
body.context-materials {
  --bg: #1e1a35;
  --surface: #2a2350;
  --surface-2: #332a5e;
  --sidebar-bg: #120f22;
  --border: #4a3f7a;
}

a {
  color: var(--accent);
}

/* Flash messages */
.flash-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flash {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  background: var(--surface-2);
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.flash-error {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #fca5a5;
}

.flash-success {
  background: rgba(34, 197, 94, 0.12);
  border-color: var(--success);
  color: #86efac;
}

.flash-danger {
  background: var(--danger-bg);
  border-color: var(--danger);
  color: #fca5a5;
}

.flash-success::before {
  content: "\2713";
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--success);
  color: #0a2e17;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

/* Brand */
.brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  margin-bottom: 32px;
}

.brand-mark {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  margin-bottom: 8px;
}

.brand-logo {
  height: 36px;
  width: auto;
  margin-bottom: 4px;
}

.brand h1 {
  font-size: 20px;
  margin: 0;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.brand-sub {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.brand-inline {
  flex-direction: row;
  align-items: center;
  margin-bottom: 0;
  gap: 10px;
}

.brand-mark-sm {
  width: 26px;
  height: 26px;
  margin-bottom: 0;
}

.brand-name {
  font-weight: 600;
  font-size: 15px;
}

/* Auth page */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 360px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px 32px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.auth-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin: 2px 0 0;
}

/* Form controls */
label {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 14px;
  margin-bottom: 2px;
}

input[type="text"],
input[type="password"],
textarea,
select {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 12px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

input[type="text"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
}

textarea {
  resize: vertical;
}

input[type="file"] {
  color: var(--text-muted);
  font-size: 13px;
  padding: 8px 0;
}

input[type="file"]::file-selector-button {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font);
  padding: 7px 12px;
  margin-right: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

input[type="file"]::file-selector-button:hover {
  background: var(--surface);
}

.btn {
  border: none;
  border-radius: 8px;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font);
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  margin-top: 22px;
}

.btn-primary:hover {
  background: var(--accent-hover);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.btn-ghost:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

.btn-danger {
  background: transparent;
  border: 1px solid #e5484d;
  color: #e5484d;
}

.btn-danger:hover {
  background: #e5484d;
  color: #fff;
}

/* Top bar */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 32px;
  border-bottom: 1px solid var(--border);
}

/* App shell (sidebar layout) */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 300px;
  flex-shrink: 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.sidebar-brand {
  display: block;
  padding: 4px 8px 22px;
}

.sidebar-logo {
  height: 30px;
  width: auto;
  display: block;
}

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

.sidebar-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin: 32px 0 8px;
  padding-top: 16px;
  padding-left: 10px;
  padding-right: 10px;
  padding-bottom: 0;
  opacity: 0.7;
  border-top: 1px solid var(--border);
}

.sidebar-section-label-materials {
  color: #c084fc;
  opacity: 0.85;
}

.sidebar-link-materials {
  border: 1px solid rgba(192, 132, 252, 0.25);
  background: rgba(192, 132, 252, 0.06);
}

.sidebar-badge-materials {
  background: #c084fc;
  color: #241b3a;
}

.sidebar-subsection-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 8px 0 2px;
  padding: 0 10px 0 20px;
  opacity: 0.55;
}

.sidebar-sub-preview {
  font-size: 10.5px;
  color: var(--text-muted);
  opacity: 0.6;
  margin: -2px 0 4px;
  padding: 0 10px 0 12px;
  white-space: nowrap;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
  mask-image: linear-gradient(to right, black 88%, transparent 100%);
}

.sidebar-row {
  display: flex;
  align-items: center;
  gap: 2px;
}

.sidebar-row .sidebar-link {
  flex: 1;
  min-width: 0;
}

.star-btn {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-muted);
  opacity: 0.35;
  font-size: 13px;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s, background 0.15s;
}

.star-btn:hover {
  opacity: 0.85;
  background: rgba(255, 255, 255, 0.06);
}

.star-btn.favorited {
  opacity: 1;
  color: #ffc80b;
}

.sidebar-link {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.sidebar-link-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sidebar-link-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.sidebar-link-icon svg {
  width: 15px;
  height: 15px;
}

.sidebar-link.active .sidebar-link-icon {
  background: rgba(79, 143, 255, 0.18);
  color: var(--accent);
}

.sidebar-link-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(to right, black 88%, transparent 100%);
  mask-image: linear-gradient(to right, black 88%, transparent 100%);
}

.sidebar-link-sub-wrap {
  position: relative;
  padding-left: 33px;
}

.sidebar-link-sub {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  opacity: 0.6;
  overflow: hidden;
  white-space: nowrap;
  -webkit-mask-image: linear-gradient(to right, black 85%, transparent 100%);
  mask-image: linear-gradient(to right, black 85%, transparent 100%);
}

/* Custom hover tooltip for truncated sidebar sub-text — replaces the slow,
   plain native browser tooltip with something faster and on-brand. Text
   itself isn't cut with a native "..." (text-overflow: ellipsis), it fades
   out via a mask instead, so Safari's automatic truncation tooltip never
   kicks in — this one is entirely ours to style and time.

   The tooltip lives on the WRAPPER (no overflow:hidden), not on the
   truncated text span itself — attaching it to the clipped span would
   clip the tooltip too, which is why it looked broken. */
.sidebar-link-sub-wrap[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  left: 33px;
  top: 100%;
  margin-top: 4px;
  z-index: 60;
  width: max-content;
  max-width: 250px;
  background: var(--surface-2);
  border: 1px solid var(--accent);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  white-space: normal;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
  opacity: 0;
  animation: sidebar-tip-in 0.1s ease-out 0.05s forwards;
  pointer-events: none;
}

@keyframes sidebar-tip-in {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

a.sidebar-link:hover {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.sidebar-link.active {
  background: rgba(255, 255, 255, 0.09);
  color: var(--text);
  font-weight: 600;
}

.sidebar-link-soon {
  color: var(--text-muted);
}

.sidebar-badge {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #241b00;
  background: #ffc80b;
  border-radius: 20px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.sidebar-footer {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  margin-top: 10px;
}

.sidebar-client-portal {
  display: block;
  padding: 7px 8px;
  border-radius: 8px;
  text-decoration: none;
  margin-bottom: 6px;
  transition: background 0.15s;
}

.sidebar-client-portal:hover {
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-client-portal-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.sidebar-client-portal-sub {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  opacity: 0.6;
  margin-top: 1px;
}

.sidebar-user-link {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 8px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-muted);
  margin-bottom: 2px;
  transition: background 0.15s, color 0.15s;
}

.sidebar-user-link:hover,
.sidebar-user-link.active {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text);
}

.user-avatar {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.user-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-username {
  font-size: 13px;
}

.app-main {
  flex: 1;
  min-width: 0;
}

/* Top bar: date+calendar (left) / search (center) / section switcher (right) */
.topbar-search-wrap {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  /* Right padding reserves room for the floating LED/Materials + Place an
     order + Favorites column (220px wide, sitting 24px from the edge) so
     the centered search bar doesn't drift under it now that column is
     position:absolute and no longer part of this flex row. */
  padding: 26px 244px 0 24px;
}

.topbar-side {
  min-width: 0;
  display: flex;
}

.topbar-side-left {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.topbar-back-link {
  padding: 6px 12px;
  font-size: 13px;
}

/* Centers the search box in the remaining space next to the date column.
   Search bar width/position no longer depend on the right-side column at
   all, since that column is now an absolutely positioned overlay (see
   .topbar-side-right below) — this is what keeps the search bar (and
   everything below it) from shifting when Favorites gains or loses a
   card. */
.topbar-search-center {
  flex: 1;
  min-width: 0;
  display: flex;
  justify-content: center;
}

/* Floats above the page instead of taking up flow height, so toggling a
   favorite (which changes this column's height) never pushes the search
   bar or page content down. */
.topbar-side-right {
  position: absolute;
  top: 26px;
  right: 24px;
  width: 220px;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  z-index: 20;
}

.topbar-favorites {
  width: 220px;
  background: rgba(79, 143, 255, 0.07);
  border: 1px solid rgba(79, 143, 255, 0.2);
  border-radius: 12px;
  padding: 10px 12px;
}

.topbar-favorites-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  opacity: 0.7;
  margin: 0 0 8px;
}

.topbar-search {
  position: relative;
  width: 100%;
  max-width: 440px;
  flex-shrink: 0;
}

.topbar-search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

input.topbar-search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 10px 16px 10px 42px;
  color: var(--text);
  font-size: 14px;
  font-family: var(--font);
  outline: none;
  transition: border-color 0.15s;
}

input.topbar-search-input:focus {
  border-color: var(--accent);
}

.nav-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  z-index: 20;
  max-height: 320px;
  overflow-y: auto;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.nav-search-section-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  opacity: 0.7;
  margin: 4px 8px 4px;
}

.nav-search-result {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
}

.nav-search-result:hover {
  background: rgba(255, 255, 255, 0.06);
}

.nav-search-result-name {
  font-size: 14px;
  font-weight: 500;
}

.nav-search-result-tagline {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-search-empty {
  padding: 10px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
  margin: 0;
}

/* Home page */
.home-page {
  max-width: 880px;
  padding: 32px 32px 80px;
  position: relative;
}

.home-datetime {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  background: transparent;
  border: none;
  font-family: var(--font);
  transition: background 0.15s;
  align-self: flex-start;
}

.home-datetime:hover {
  background: rgba(255, 255, 255, 0.05);
}

.home-date {
  color: var(--text);
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  text-transform: capitalize;
}

.home-time {
  color: var(--text-muted);
  font-size: 16px;
  margin: 0;
}

.home-calendar-popover {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 30;
  width: 260px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.home-calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.home-calendar-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.home-calendar-nav {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 2px 6px;
  border-radius: 6px;
}

.home-calendar-nav:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.home-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  text-align: center;
}

.home-calendar-weekday {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  padding: 4px 0;
}

.home-calendar-day {
  font-size: 12px;
  color: var(--text);
  padding: 6px 0;
  border-radius: 6px;
}

.home-calendar-day.is-muted {
  color: var(--text-muted);
  opacity: 0.35;
}

.home-calendar-day.is-today {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

/* Section switcher (top right — LED vs Materials) */
.section-switcher {
  position: relative;
  display: flex;
  justify-content: flex-end;
}

.section-switcher-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #ffc80b;
  border: 1px solid #ffc80b;
  border-radius: 999px;
  padding: 8px 14px;
  color: #241b00;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font);
  cursor: pointer;
}

.section-switcher-btn:hover {
  background: #ffd438;
  border-color: #ffd438;
}

.section-switcher-chevron {
  font-size: 16px;
  line-height: 1;
  color: #241b00;
  opacity: 0.7;
}

.section-switcher-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 30;
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

.section-switcher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: 13.5px;
  transition: background 0.15s;
}

.section-switcher-item:hover {
  background: rgba(255, 255, 255, 0.07);
}

.section-switcher-item.is-current {
  color: var(--text-muted);
  cursor: default;
}

.section-switcher-item.is-current:hover {
  background: transparent;
}

.section-switcher-item .sidebar-badge-materials {
  font-size: 9px;
}

/* Hero slideshow */
.hero-slideshow {
  position: relative;
  border-radius: 16px;
  min-height: 260px;
  margin-bottom: 32px;
  overflow: hidden;
  background: linear-gradient(135deg, #1c3a6e 0%, #16233d 55%, #0b1424 100%);
  border: 1px solid rgba(79, 143, 255, 0.25);
  cursor: pointer;
}

.hero-slide {
  display: none;
  position: absolute;
  inset: 0;
  padding: 28px 32px;
  flex-direction: column;
  justify-content: flex-end;
  background-size: cover;
  background-position: center;
}

.hero-slide.is-active {
  display: flex;
  animation: hero-fade 0.5s ease;
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(11, 20, 36, 0.94) 0%,
    rgba(11, 20, 36, 0.78) 38%,
    rgba(11, 20, 36, 0.3) 72%,
    rgba(11, 20, 36, 0.05) 100%
  );
}

.hero-slide > * {
  position: relative;
  z-index: 1;
}

@keyframes hero-fade {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #ffc80b;
  margin: 0 0 10px;
  font-weight: 700;
}

.hero-heading {
  font-size: 21px;
  line-height: 1.35;
  margin: 0 0 12px;
  font-weight: 600;
  max-width: 620px;
}

.hero-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0;
  max-width: 560px;
}

.hero-dots {
  position: absolute;
  left: 32px;
  bottom: 16px;
  z-index: 2;
  display: flex;
  gap: 6px;
}

.hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: none;
  background: rgba(238, 241, 248, 0.25);
  cursor: pointer;
  padding: 0;
}

.hero-dot.is-active {
  background: #ffc80b;
}

/* Favorites — docked permanently in the topbar, same spot on every page */
.favorites-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.favorite-card {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 10px;
  text-decoration: none;
  color: var(--text);
  font-size: 13px;
  font-weight: 500;
  cursor: grab;
  transition: border-color 0.15s, background 0.15s;
}

.favorite-card:hover {
  border-color: var(--accent);
}

.favorite-card.is-dragging {
  opacity: 0.5;
}

.favorite-card-drag {
  color: var(--text-muted);
  font-size: 11px;
  line-height: 1;
}

.favorite-card-name {
  white-space: nowrap;
}

/* Secondary, de-emphasized section */
.home-secondary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 24px;
}

.home-secondary .home-section-label {
  font-size: 11px;
}

.home-secondary-col-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 12px;
  opacity: 0.85;
  transition: opacity 0.15s;
}

.home-secondary-col-link:hover {
  opacity: 1;
}

.home-secondary-col-arrow {
  opacity: 0;
  transition: opacity 0.15s;
  color: var(--accent);
}

.home-secondary-col-link:hover .home-secondary-col-arrow {
  opacity: 1;
}

/* "Today's shipments" gets extra visual weight so it doesn't get lost —
   it's the main way anyone (Tautvydas especially) notices new shipments,
   since there's deliberately no separate nav item or topbar button for it. */
.home-secondary-col-featured {
  opacity: 1;
  background: rgba(255, 200, 11, 0.07);
  border: 1px solid rgba(255, 200, 11, 0.4);
  border-radius: 14px;
  padding: 16px 18px 4px;
}

.home-secondary-col-featured:hover {
  opacity: 1;
  border-color: #ffc80b;
  background: rgba(255, 200, 11, 0.12);
}

.home-secondary-col-featured .home-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  color: var(--text);
  margin-bottom: 10px;
}

.home-secondary-col-featured .home-secondary-col-arrow {
  opacity: 1;
  margin-left: auto;
  font-weight: 700;
}

.home-secondary-col-featured .activity-list {
  border: none;
  margin-bottom: 0;
}

.home-secondary-col-featured .activity-item {
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 200, 11, 0.2);
}

.activity-item-number {
  color: var(--text-muted);
  font-weight: 500;
  margin-right: 2px;
}

.home-secondary-col-featured .activity-empty {
  padding: 14px 0;
}

.activity-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.home-secondary-col-featured .shipment-queue-status {
  font-size: 10.5px;
  padding: 2px 8px;
}

.home-secondary-more {
  margin: 2px 0 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.activity-list-small .activity-item {
  padding: 10px 14px;
  font-size: 13px;
}

.activity-list-small .activity-empty {
  padding: 16px 14px;
  font-size: 12.5px;
}

/* Global "Place an order" CTA — lives in the topbar next to the
   LED/Materials switcher, visible on every page (same idea as Favorites). */
.topbar-order-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 220px;
  margin-top: 10px;
  background: #ffc80b;
  border: 1px solid #ffc80b;
  border-radius: var(--radius);
  padding: 10px 14px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}

.topbar-order-btn-icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(36, 27, 0, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #241b00;
}

.topbar-order-btn-icon svg {
  width: 13px;
  height: 13px;
}

.topbar-order-btn.is-active .topbar-order-btn-icon {
  background: rgba(255, 200, 11, 0.18);
  color: #ffc80b;
}

.topbar-order-btn:hover {
  background: #e6b400;
  border-color: #e6b400;
}

.topbar-order-btn:active {
  transform: scale(0.98);
}

.topbar-order-btn.is-active {
  background: #241b00;
  border-color: #ffc80b;
}

.topbar-order-btn.is-active .topbar-order-btn-title,
.topbar-order-btn.is-active .topbar-order-btn-arrow {
  color: #ffc80b;
}

.topbar-order-btn-title {
  flex: 1;
  font-size: 13.5px;
  font-weight: 700;
  color: #241b00;
}

.topbar-order-btn-arrow {
  font-size: 15px;
  font-weight: 700;
  color: #241b00;
  flex-shrink: 0;
}

.home-section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.activity-list {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.activity-list:last-child {
  margin-bottom: 0;
}

.activity-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-time {
  font-size: 12px;
  color: var(--text-muted);
}

.activity-empty {
  padding: 20px 16px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.pitch-card {
  margin-top: 40px;
  padding: 28px;
  border-radius: 16px;
  background: linear-gradient(160deg, rgba(79, 143, 255, 0.14), rgba(34, 211, 238, 0.05));
  border: 1px solid rgba(79, 143, 255, 0.25);
}

.pitch-kicker {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 10px;
  font-weight: 700;
}

.pitch-heading {
  font-size: 20px;
  line-height: 1.35;
  margin: 0 0 14px;
  font-weight: 600;
}

.pitch-body {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-muted);
  margin: 0 0 24px;
  max-width: 620px;
}

.pitch-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 18px;
}

.pitch-point-title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 6px;
}

.pitch-point-body {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-muted);
  margin: 0;
}

/* Profile page */
.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.profile-avatar-lg {
  width: 60px;
  height: 60px;
  flex-shrink: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  overflow: hidden;
}

.profile-avatar-upload {
  position: relative;
  cursor: pointer;
}

.profile-avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-avatar-edit {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0;
  transition: opacity 0.15s;
}

.profile-avatar-upload:hover .profile-avatar-edit {
  opacity: 1;
}

.profile-name {
  font-size: 19px;
  font-weight: 600;
  margin: 0;
}

.profile-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0 0 8px;
}

.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}

.profile-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}

.profile-card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin: 4px 0 0;
}

/* Roadmap page */
.roadmap-page {
  max-width: 720px;
  padding: 36px 32px 80px;
}

.roadmap-title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.roadmap-title-row .roadmap-title {
  margin: 0;
}

.roadmap-badge {
  display: inline-block;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #241b00;
  background: #ffc80b;
  border-radius: 20px;
  padding: 4px 10px;
}

.roadmap-title {
  font-size: 26px;
  margin: 0 0 8px;
}

.roadmap-tagline {
  font-size: 15px;
  color: var(--text-muted);
  margin: 0 0 28px;
}

.roadmap-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
}

.roadmap-option-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: default;
}

.roadmap-option-chip-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffc80b;
  flex-shrink: 0;
}

.roadmap-option-chip-star {
  flex-shrink: 0;
  margin-left: 2px;
  padding: 0;
  background: transparent;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.35;
  cursor: pointer;
  transition: opacity 0.15s, color 0.15s;
}

.roadmap-option-chip:hover .roadmap-option-chip-star {
  opacity: 0.8;
  color: #ffc80b;
}

.roadmap-option-chip-star.favorited {
  opacity: 1;
  color: #ffc80b;
}

.roadmap-pitch {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 32px;
}

.roadmap-point {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.roadmap-point-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin-top: 1px;
  border-radius: 50%;
  background: rgba(255, 200, 11, 0.15);
  color: #ffc80b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.roadmap-point p {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
}

.roadmap-mailbox-preview {
  margin-bottom: 32px;
}

.roadmap-mailbox-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 10px;
}

.roadmap-mailbox-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-radius: 12px;
  border: 1px dashed rgba(255, 200, 11, 0.35);
  background: rgba(255, 200, 11, 0.05);
}

.roadmap-mailbox-title {
  margin: 0 0 4px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
}

.roadmap-mailbox-sub {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
  max-width: 420px;
}

.roadmap-mailbox-box .btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  flex-shrink: 0;
}

/* Create shipment page */
.shipments-page {
  max-width: 720px;
  padding: 36px 32px 80px;
}

.shipments-page h1 {
  font-size: 22px;
  margin: 0 0 6px;
}

.shipments-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 24px;
}

.shipment-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.shipment-tab {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px 8px 0 0;
  padding: 9px 16px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  font-family: var(--font);
}

.shipment-tab.is-active {
  background: rgba(79, 143, 255, 0.14);
  border-color: rgba(79, 143, 255, 0.35);
  color: var(--accent-hover);
}

.shipment-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
}

.shipment-form textarea {
  min-height: 90px;
}

.shipment-form-hint {
  font-size: 12px;
  color: var(--text-muted);
  opacity: 0.8;
  margin: 4px 0 0;
  line-height: 1.5;
}

.shipment-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 8px;
}

.shipment-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  background: var(--surface);
}

.shipment-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.shipment-client {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}

.shipment-meta {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.shipment-products {
  font-size: 13.5px;
  color: var(--text);
  white-space: pre-wrap;
  margin: 0 0 8px;
  line-height: 1.6;
}

.shipment-notes {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: pre-wrap;
  margin: 0 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.shipment-attachment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--accent);
  text-decoration: none;
  margin: 0 0 12px;
}

.shipment-attachment:hover {
  text-decoration: underline;
}

.shipment-card.is-done {
  opacity: 0.6;
}

.activity-event-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, background 0.15s;
}

.activity-event-card:hover {
  border-color: var(--accent);
  background: rgba(79, 143, 255, 0.08);
}

.shipments-done-section {
  margin-top: 32px;
}

.shipments-done-section .home-section-label {
  margin-bottom: 10px;
}

.shipment-detail-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0));
  background-color: var(--surface);
  padding: 26px 28px;
  margin-bottom: 20px;
}

.shipment-detail-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

.shipment-detail-title {
  font-size: 24px;
  margin: 0 0 6px;
}

.shipment-detail-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-muted);
  margin: 0;
}

.shipment-detail-meta strong {
  color: var(--text);
  font-weight: 600;
}

.shipment-detail-dot {
  opacity: 0.5;
}

.shipment-detail-status {
  flex-shrink: 0;
  font-size: 12px;
  padding: 5px 14px;
}

.shipment-detail-section {
  margin-top: 18px;
}

.shipment-detail-section:first-of-type {
  margin-top: 0;
}

.shipment-detail-notes {
  border-top: none;
  padding-top: 0;
  margin: 0;
}

.shipment-detail-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.shipment-detail-btn-icon {
  width: 14px;
  height: 14px;
  margin-right: 6px;
  vertical-align: -2px;
}

.shipment-detail-soon-btn {
  margin-left: auto;
  gap: 8px;
  opacity: 0.85;
}

.shipment-detail-soon-btn:hover {
  opacity: 1;
}

.shipment-detail-soon-tag {
  font-size: 10px;
  padding: 2px 8px;
}

/* Shipments queue (/shipments/queue) */
.shipments-filter-row {
  display: flex;
  gap: 10px;
  margin-bottom: 18px;
}

.shipments-filter-row select {
  padding: 9px 12px;
  width: auto;
  min-width: 150px;
}

.shipments-filter-static {
  display: flex;
  align-items: center;
  padding: 9px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-muted);
  background: var(--surface);
}

.shipments-recycle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-muted);
  background: var(--surface);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}

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

.shipments-recycle-btn:hover {
  color: #e5484d;
  border-color: #e5484d;
}

.shipments-recycle-btn.is-active {
  color: #e5484d;
  border-color: #e5484d;
  background: rgba(229, 72, 77, 0.1);
}

.shipment-queue-list {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.shipment-queue-row {
  display: grid;
  grid-template-columns: 150px 1fr 130px 110px 72px;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  transition: background 0.15s;
}

.shipment-queue-row:hover {
  background: rgba(79, 143, 255, 0.05);
}

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

.shipment-queue-header {
  background: var(--surface-2);
  cursor: default;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 10px 16px;
}

.shipment-queue-header:hover {
  background: var(--surface-2);
}

.shipment-queue-datetime {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
  text-decoration: none;
}

.shipment-queue-client {
  font-size: 14px;
  font-weight: 600;
  color: inherit;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-queue-user {
  font-size: 12.5px;
  color: var(--text-muted);
}

.shipment-queue-status {
  justify-self: start;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

.shipment-queue-status-pending {
  background: rgba(255, 200, 11, 0.15);
  color: #ffc80b;
}

.shipment-queue-status-waiting-on-stock {
  background: rgba(79, 143, 255, 0.15);
  color: var(--accent);
}

.shipment-queue-status-done {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}

.shipment-queue-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  justify-self: end;
}

.shipment-queue-actions form {
  display: contents;
}

.shipment-queue-icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.shipment-queue-icon-btn svg {
  width: 15px;
  height: 15px;
}

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

.shipment-queue-icon-btn-danger:hover {
  background: rgba(229, 72, 77, 0.12);
  color: #e5484d;
}

@media (max-width: 720px) {
  .shipment-queue-header {
    display: none;
  }
  .shipment-queue-row {
    grid-template-columns: 1fr auto;
    grid-template-areas: "client status" "datetime user" "actions actions";
  }
  .shipment-queue-client { grid-area: client; }
  .shipment-queue-status { grid-area: status; }
  .shipment-queue-datetime { grid-area: datetime; }
  .shipment-queue-user { grid-area: user; }
  .shipment-queue-actions { grid-area: actions; justify-self: start; }
}

/* Calculator page */
.calc-page {
  display: flex;
  justify-content: center;
  padding: 36px 24px 80px;
}

.calc-card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px;
}

.calc-card h1 {
  margin: 0 0 6px;
  font-size: 22px;
}

.calc-sub {
  color: var(--text-muted);
  font-size: 14px;
  margin: 0 0 8px;
}

.calc-form {
  display: flex;
  flex-direction: column;
}

.dropzone {
  margin-top: 6px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  position: relative;
  overflow: hidden;
  background: var(--surface-2);
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--accent);
  background: rgba(79, 143, 255, 0.1);
}

.dropzone-content {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 20px;
}

.dropzone-icon {
  display: block;
  font-size: 24px;
  color: var(--accent);
  margin-bottom: 6px;
}

.preview-img {
  max-width: 100%;
  max-height: 260px;
  object-fit: contain;
}

.result-panel {
  margin-top: 28px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

.result-panel h2 {
  font-size: 15px;
  margin: 0 0 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.result-content {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  white-space: pre-wrap;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px;
  color: var(--text);
  margin: 0;
}

.loading-indicator {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  color: var(--text-muted);
  font-size: 13px;
}

.loading-indicator[hidden] {
  display: none;
}

.spinner {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

.error-panel {
  margin-top: 20px;
  background: var(--danger-bg);
  border: 1px solid var(--danger);
  color: #fca5a5;
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
}

/* Assistant — floating chat launcher + panel, visible on every page for
   the small set of people with can_use_assistant. Fixed position so it
   never affects page layout (same lesson as the topbar-side-right fix). */
.assistant-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 50;
}

.assistant-fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
  transition: background 0.15s, transform 0.15s;
}
.assistant-fab:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.assistant-fab.is-open {
  background: var(--surface-2);
}
.assistant-fab svg {
  width: 24px;
  height: 24px;
}

.assistant-panel {
  position: absolute;
  right: 0;
  bottom: 64px;
  width: 340px;
  height: 460px;
  max-height: calc(100vh - 120px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.assistant-panel[hidden] {
  display: none;
}

.assistant-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.assistant-panel-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  font-size: 14px;
}
.assistant-panel-title-icon {
  width: 15px;
  height: 15px;
  color: var(--accent);
  flex-shrink: 0;
}
.assistant-panel-close {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  border-radius: 6px;
}
.assistant-panel-close:hover {
  color: var(--text);
  background: var(--surface-2);
}
.assistant-panel-close svg {
  width: 16px;
  height: 16px;
}

.assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.assistant-empty {
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.5;
  margin: auto 0;
  text-align: center;
}

.assistant-msg p {
  margin: 0;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13.5px;
  line-height: 1.45;
  max-width: 85%;
  white-space: pre-wrap;
}
.assistant-msg-user {
  display: flex;
  justify-content: flex-end;
}
.assistant-msg-user p {
  background: var(--accent);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.assistant-msg-assistant p {
  background: var(--surface-2);
  color: var(--text);
  border-bottom-left-radius: 4px;
}

.assistant-msg-typing p {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px;
}
.assistant-msg-typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-muted);
  animation: assistant-typing 1s infinite ease-in-out;
}
.assistant-msg-typing span:nth-child(2) { animation-delay: 0.15s; }
.assistant-msg-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes assistant-typing {
  0%, 60%, 100% { opacity: 0.3; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-2px); }
}

.assistant-input-row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.assistant-input {
  flex: 1;
  resize: none;
  min-height: 36px;
  max-height: 120px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-family: var(--font);
  font-size: 13.5px;
  padding: 8px 10px;
  line-height: 1.4;
}
.assistant-input:focus {
  outline: none;
  border-color: var(--accent);
}
.assistant-send {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.assistant-send:hover {
  background: var(--accent-hover);
}
.assistant-send svg {
  width: 16px;
  height: 16px;
}

/* ============================================================
   Mobile layout — sidebar becomes an off-canvas drawer, topbar
   stacks, and the pages that actually get used on a phone
   (Shipments: place an order, queue, detail, edit) get sized for
   touch. The shell changes apply everywhere since sidebar/topbar
   are shared across every page, but the polish pass below is
   focused on Shipments, which is what this was actually for.
   ============================================================ */

.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 150;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  cursor: pointer;
}

.mobile-menu-btn svg {
  width: 18px;
  height: 18px;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  z-index: 190;
}

.sidebar-overlay.is-open {
  display: block;
}

.sidebar-brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 8px;
  margin-right: 4px;
  cursor: pointer;
}

.sidebar-close-btn svg {
  width: 18px;
  height: 18px;
}

@media (max-width: 860px) {
  .mobile-menu-btn {
    display: flex;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    width: 82vw;
    max-width: 300px;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 8px 0 24px rgba(0, 0, 0, 0.4);
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-close-btn {
    display: flex;
  }

  /* Room for the fixed hamburger button so it doesn't sit on top of the
     topbar's own content. */
  .app-main {
    padding-top: 52px;
  }

  .topbar-search-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    padding: 16px 16px 0;
  }

  .topbar-side-left {
    align-items: stretch;
  }

  .topbar-search-center {
    justify-content: stretch;
  }

  .topbar-search {
    max-width: none;
  }

  /* This column floats (position: absolute) on desktop so Favorites
     resizing never shifts the search bar. On mobile there's no room to
     float it — put it back in normal flow, stacked below the search. */
  .topbar-side-right {
    position: static;
    width: 100%;
    top: auto;
    right: auto;
  }

  .topbar-order-btn,
  .topbar-favorites {
    width: 100%;
  }

  .section-switcher {
    justify-content: stretch;
  }

  .section-switcher-btn {
    width: 100%;
    justify-content: center;
  }

  .home-page,
  .shipments-page,
  .roadmap-page,
  .calc-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .home-secondary {
    flex-direction: column;
  }

  .hero-heading {
    font-size: 22px;
  }

  /* Shipments: place an order form already stacks by default (labels and
     inputs are block-level), the main thing it needs is less side padding
     and full-width submit, both covered above and below. */
  .shipment-form .btn-primary {
    width: 100%;
  }

  .shipment-tabs {
    width: 100%;
  }

  .shipment-tab {
    flex: 1;
    text-align: center;
  }

  /* Shipments queue: filters stack instead of squeezing two selects
     side by side. */
  .shipments-filter-row {
    flex-direction: column;
  }

  .shipments-filter-row select {
    width: 100%;
  }

  /* Shipment detail: title + status badge stack instead of competing
     for width, and action buttons go full-bleed so they're easy to tap. */
  .shipment-detail-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .shipment-detail-card {
    padding: 20px 18px;
  }

  .shipment-detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .shipment-detail-actions .btn,
  .shipment-detail-actions form {
    width: 100%;
  }

  .shipment-detail-actions .btn {
    justify-content: center;
  }

  .shipment-detail-soon-btn {
    margin-left: 0;
    order: 10;
  }

  /* Shipments queue rows already reflow via the 720px breakpoint above —
     this just tightens the outer page padding to match. */
  .shipment-queue-row {
    padding: 12px;
  }
}
