/* Web-only additions on top of the native stylesheet (/static/style.css).
   Everything visual comes from the native sheet; this file only covers
   surfaces that don't exist in the native app (sign-in, setup form) and the
   few native actions that aren't wired up on web yet. */

/* Sign out icon sits with the native .icon-btn cluster; nothing extra needed. */

/* ---------- bare pages: sign-in / sign-out ---------- */
body.bare { min-height: 100vh; display: grid; place-items: center; }
main.bare-main { width: min(430px, calc(100% - 36px)); padding: 0; }
.signin-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 34px;
}
.signin-brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 19px; font-weight: 700; letter-spacing: -0.02em;
}
.signin-brand .logo { width: 26px; height: 26px; }
.signin-card h1 { font-size: 25px; margin: 26px 0 10px; letter-spacing: -0.03em; }
.providers { display: grid; gap: 10px; margin-top: 24px; }
.providers .btn { width: 100%; justify-content: center; padding: 13px 16px; font-weight: 650; }
.github-icon { width: 18px; height: 18px; }
.error { color: var(--danger); }

/* The shared stylesheet gives .inline-form an explicit display, which would
   otherwise override the HTML hidden attribute the wizard toggles. */
.inline-form[hidden] { display: none; }

.practice-choice .inline-form { margin-top: 10px; }
.inline-link { background: none; border: 0; padding: 0; font: inherit; cursor: pointer; }

/* ---------- setup form (web-editable study plan) ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.field label { font-weight: 600; font-size: 14px; }
.field input, .field select {
  font: inherit; font-size: 14px;
  padding: 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  max-width: 280px;
}
.field input::placeholder, .set-ctl input::placeholder { color: var(--faint); }
.field input:focus-visible, .field select:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.field-row { display: flex; gap: 18px; flex-wrap: wrap; }
.field-row .field input { max-width: 130px; }

/* ---------- settings page: account identity ---------- */
.acct-row { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.acct-avatar {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center; overflow: hidden;
  border-radius: 50%;
  background: var(--accent-soft); color: var(--accent);
  font-weight: 700; font-size: 17px;
}
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct-meta { display: flex; flex-direction: column; }
.acct-meta strong { font-size: 14.5px; letter-spacing: -0.01em; }
.acct-chip {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted); background: var(--fill);
  padding: 3px 9px; border-radius: 6px;
}

/* ---------- settings page: icon-chip section headers ---------- */
.section-head.sh-modern { justify-content: flex-start; align-items: center; gap: 12px; }
.sh-modern .sh-icon {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--accent-soft); color: var(--accent);
}
.sh-modern .sh-icon svg { width: 17px; height: 17px; }
.sh-modern .sh-text h2 {
  margin: 0; text-transform: none; letter-spacing: -0.02em;
  font-size: 16px; font-weight: 700; color: var(--text);
}
.sh-modern .sh-text p { margin: 1px 0 0; font-size: 12.5px; color: var(--muted); }
.sh-modern .count { margin-left: auto; }
.danger-zone .sh-modern .sh-icon {
  background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger);
}
.danger-zone .sh-modern .sh-text h2 { color: var(--danger); }

/* ---------- settings page: device rows ---------- */
.dev-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.dev-row:last-child { border-bottom: 0; padding-bottom: 4px; }
.dev-avatar {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--fill); color: var(--muted);
  font-weight: 700; font-size: 15px;
}
.dev-main { display: flex; flex-direction: column; }
.dev-main strong { font-size: 14px; }
.dev-seen { margin-left: auto; }

/* ---------- settings page: label-left / control-right rows ---------- */
.set-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px 28px; padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.set-info { flex: 1 1 220px; min-width: 200px; }
.set-info > label { display: block; font-weight: 600; font-size: 14px; }
.set-info p { margin: 3px 0 0; font-size: 12.5px; color: var(--muted); line-height: 1.5; max-width: 360px; }
.set-ctl {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 8px; flex-wrap: wrap;
}
.set-ctl select, .set-ctl input[type=date] {
  font: inherit; font-size: 14px;
  padding: 9px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  min-width: 210px;
}
.set-ctl select {
  appearance: none; -webkit-appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' fill='none' stroke='%23888890' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.set-ctl select:focus-visible, .set-ctl input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
.set-limits { gap: 14px; }
.mini-field { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: text; }
.mini-field input {
  width: 82px; text-align: center;
  font: inherit; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums;
  padding: 8px 4px 8px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
}
.mini-field span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
#plan-form .set-row:last-of-type { border-bottom: 0; }
.set-foot {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
  padding-top: 16px; border-top: 1px dashed var(--border-strong);
}
.set-foot .btn-primary { padding: 9px 20px; font-size: 13.5px; }
.set-dirty { font-size: 12.5px; font-weight: 600; color: var(--warn); animation: fb-in 0.18s ease; }
.set-dirty::before { content: "●"; margin-right: 6px; font-size: 9px; vertical-align: 1px; }
@media (max-width: 620px) {
  .set-row { flex-direction: column; align-items: stretch; }
  .set-ctl { justify-content: flex-start; }
  .set-foot { justify-content: flex-start; }
}

/* Custom dropdown (target list) — replaces the native select popup. */
.dd { position: relative; }
.dd select.dd-native { display: none; }
.dd-btn, .dp-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 10px;
  min-width: 210px;
  font: inherit; font-size: 14px; color: var(--text); text-align: left;
  padding: 9px 14px;
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  cursor: pointer;
}
.dd-btn svg, .dp-btn > svg { color: var(--muted); flex: none; }
.dp-btn { justify-content: flex-start; }
.dd-btn:focus-visible, .dp-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dd-menu {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  min-width: 100%; padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
  animation: fb-in 0.15s ease;
}
.dd-opt {
  display: flex; align-items: center; gap: 9px; width: 100%;
  font: inherit; font-size: 13.5px; color: var(--text); text-align: left;
  padding: 8px 12px 8px 10px;
  background: none; border: 0; border-radius: 9px;
  cursor: pointer; white-space: nowrap;
}
.dd-opt:hover, .dd-opt:focus-visible { background: var(--accent-soft); outline: none; }
.dd-opt .dd-check { width: 14px; flex: none; display: inline-flex; color: var(--accent); opacity: 0; }
.dd-opt[aria-selected="true"] .dd-check { opacity: 1; }
.dd-opt[aria-selected="true"] { font-weight: 650; }
.dd-group {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint);
  padding: 9px 10px 3px;
}

/* Custom calendar popover (deadline) — replaces the native date picker. */
.dp-anchor { position: relative; }
.dp-pop {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 60;
  width: 270px; padding: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 14px 38px rgba(0, 0, 0, 0.18);
  animation: fb-in 0.15s ease;
}
.dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dp-title { font-size: 13.5px; font-weight: 700; letter-spacing: -0.01em; }
.dp-nav { display: flex; gap: 2px; }
.dp-nav button {
  width: 26px; height: 26px; display: grid; place-items: center;
  font: inherit; font-size: 15px; color: var(--muted);
  background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.dp-nav button:hover { background: var(--fill); color: var(--text); }
.dp-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; justify-items: center; }
.dp-dow {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase;
  color: var(--faint); padding: 4px 0;
}
.dp-day {
  width: 32px; height: 30px; display: grid; place-items: center;
  font: inherit; font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--text);
  background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.dp-day:hover { background: var(--fill); }
.dp-day.out { color: var(--faint); }
.dp-day.today { box-shadow: inset 0 0 0 1px var(--border-strong); }
.dp-day.sel { background: var(--accent); color: var(--accent-contrast); font-weight: 650; }
.dp-day.sel:hover { background: var(--accent); }
.dp-foot {
  display: flex; justify-content: space-between;
  margin-top: 10px; padding-top: 9px;
  border-top: 1px solid var(--border);
}
.dp-foot button {
  font: inherit; font-size: 12.5px; font-weight: 650; color: var(--accent);
  background: none; border: 0; border-radius: 6px; padding: 2px 4px; cursor: pointer;
}
.dp-foot button:hover { text-decoration: underline; }
@media (max-width: 620px) {
  .dd-menu, .dp-pop { right: auto; left: 0; }
}

.day-grid { display: flex; gap: 6px; flex-wrap: wrap; }
.day-box {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 46px; padding: 7px 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--pill);
  cursor: pointer; user-select: none;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.day-box input { position: absolute; opacity: 0; pointer-events: none; }
.day-box:hover { border-color: var(--accent); color: var(--accent); }
.day-box:has(input:checked) {
  background: var(--accent); border-color: var(--accent);
  color: var(--accent-contrast);
}
.day-box:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- collapsible cards (Devices) ----------
   The disclosure chevron comes from the native sheet's details.fold pattern
   (style.css); these rules only adapt it to a section-head summary. */
details.fold > summary.section-head { justify-content: flex-start; }
details.fold > summary.section-head .count { margin-left: auto; }
details.fold:not([open]) > summary.section-head { border-bottom: 0; padding-bottom: 0; }
.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.row:last-child { border-bottom: none; }

/* ---------- floating feedback widget ---------- */
.fb-widget {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.fb-fab {
  display: inline-flex; align-items: center; gap: 7px;
  font: inherit; font-size: 13px; font-weight: 600;
  color: var(--muted);
  background: var(--card);
  border: 1px solid var(--border-strong);
  border-radius: var(--pill);
  padding: 8px 14px;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: color 0.15s ease, border-color 0.15s ease;
}
.fb-fab:hover, .fb-fab[aria-expanded="true"] {
  color: var(--accent);
  border-color: var(--accent);
}
.fb-pop {
  position: relative;
  width: min(330px, calc(100vw - 40px));
  margin-bottom: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  animation: fb-in 0.18s ease;
}
@keyframes fb-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
.fb-title { font-size: 15px; font-weight: 700; letter-spacing: -0.02em; margin: 0; }
.fb-sub { font-size: 13px; color: var(--muted); margin: 3px 0 12px; }
.fb-chips { display: flex; gap: 7px; margin-bottom: 10px; }
.fb-chip {
  font: inherit; font-size: 12.5px; font-weight: 600;
  color: var(--muted);
  background: var(--fill);
  border: 1px solid transparent;
  border-radius: var(--pill);
  padding: 5px 13px;
  cursor: pointer;
}
.fb-chip.on {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent);
}
.fb-pop textarea {
  width: 100%;
  resize: vertical;
  min-height: 74px;
  font: inherit; font-size: 13.5px; line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  box-sizing: border-box;
}
.fb-pop textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fb-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.fb-note { font-size: 11.5px; color: var(--faint); }
.fb-send {
  font: inherit; font-size: 13px; font-weight: 650;
  color: var(--accent-contrast);
  background: var(--accent);
  border: 0;
  border-radius: var(--pill);
  padding: 7px 18px;
  cursor: pointer;
}
.fb-send:disabled { opacity: 0.45; cursor: default; }
.fb-done {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--card);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  animation: fb-in 0.18s ease;
}
.fb-done[hidden] { display: none; }
.fb-done-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--ok);
  color: #fff;
  font-size: 13px;
}
@media print { .fb-widget { display: none; } }

/* Company-targeted lists — Problems page hero */
.company-hero { display: flex; align-items: center; gap: 16px; }
.company-logo {
  width: 58px; height: 58px; flex: none;
  display: grid; place-items: center;
  border-radius: 14px;
  font-size: 16.5px; font-weight: 800; letter-spacing: -0.02em;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.30), inset 0 0 0 1px rgba(255, 255, 255, 0.16);
}
.company-meta h1 { display: flex; align-items: center; gap: 10px; margin: 0 0 3px; }
.company-chip {
  font-size: 11px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  padding: 3px 10px; border-radius: 999px;
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  white-space: nowrap;
}
.company-tagline { max-width: 660px; }

/* Companies tab — one card per company list */
.companies-grid {
  display: grid; gap: 18px;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
.company-card {
  display: flex; flex-direction: column; gap: 12px;
  color: inherit; text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.company-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.22);
}
.company-card-head { display: flex; align-items: center; gap: 14px; }
.company-card-head .company-logo { width: 50px; height: 50px; border-radius: 12px; font-size: 14.5px; }
.company-card-title h2 {
  margin: 0 0 2px; font-size: 19px; letter-spacing: -0.02em;
  /* Undo the global section-label h2 (uppercase, muted) — this is a headline. */
  text-transform: none; color: var(--text); font-weight: 700;
}
.company-card-title p { margin: 0; font-size: 13.5px; }
.company-bar {
  height: 6px; border-radius: 999px; overflow: hidden;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}
.company-bar span { display: block; height: 100%; border-radius: 999px; background: var(--accent); }
.company-card-tagline { margin: 0; font-size: 13.5px; line-height: 1.5; }
.company-card-cta { margin-top: auto; font-size: 13.5px; font-weight: 650; color: var(--accent); }
