/* Cowoni web UI — Apple-like system surfaces; Bootstrap 5 is loaded first for layout utilities. */
/* `:hover` feedback is wrapped in `@media (hover: hover) and (pointer: fine)` so phones/tablets avoid sticky grey rows and bogus “hover” on tap. */

:root {
  --bg: #f5f5f7;
  --bg-elevated: #ffffff;
  --text: #1d1d1f;
  --text-secondary: #86868b;
  /* Small uppercase section labels (Live, History, Overview, …) */
  --subheading: #999;
  --separator: rgba(60, 60, 67, 0.12);
  --separator-strong: rgba(60, 60, 67, 0.18);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-press: #005bb5;
  --focus: rgba(0, 113, 227, 0.35);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 10px;
  /* Raised surfaces (settings cards, status panel, hero, legacy .card) — light, not floating */
  --shadow-surface: 0 1px 2px rgba(0, 0, 0, 0.04);
  --topbar-blur: saturate(180%) blur(20px);
  /*
   * Fixed topbar: reserve space on main (below safe area). Matches ~navbar min-height 52px + py-2 + border;
   * mobile topbar is brand-only (tabs live in the bottom bar).
   */
  --cowoni-topbar-inner: 69px;
  --cowoni-bottombar-inner: 0px;
}

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

html {
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-gutter: stable;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + var(--cowoni-topbar-inner) + 12px);
}

html::-webkit-scrollbar {
  display: none;
}

body.cowoni-app-body,
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "SF Pro Text",
    "SF Pro Display",
    "Segoe UI",
    system-ui,
    sans-serif;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.cowoni-app-body {
  position: relative;
}

.cowoni-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(0, 113, 227, 0.09), transparent 55%),
    radial-gradient(900px 500px at 95% 20%, rgba(175, 82, 222, 0.06), transparent 50%),
    radial-gradient(800px 480px at 50% 100%, rgba(52, 199, 89, 0.05), transparent 45%),
    var(--bg);
}

.cowoni-topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 100;
  padding-top: env(safe-area-inset-top, 0px);
  border-bottom: 1px solid var(--separator);
  background: rgba(245, 245, 247, 0.72);
  -webkit-backdrop-filter: var(--topbar-blur);
  backdrop-filter: var(--topbar-blur);
}

.cowoni-brand {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.cowoni-mark {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.2;
  color: var(--text);
}

.cowoni-brand-sub {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Bootstrap navbar in frosted topbar — keep Cowoni typography, align with page tokens */
.cowoni-topbar .navbar {
  --bs-navbar-color: rgba(29, 29, 31, 0.78);
  --bs-navbar-hover-color: var(--text);
  --bs-navbar-active-color: var(--text);
  min-height: 52px;
}

.cowoni-topbar .navbar-brand.cowoni-brand--link {
  font-size: inherit;
  line-height: inherit;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  .cowoni-topbar .navbar-brand.cowoni-brand--link:hover .cowoni-mark {
    color: #000;
  }
}

.cowoni-topbar .navbar-brand.cowoni-brand--link:focus-visible {
  outline: none;
  border-radius: 8px;
  box-shadow: 0 0 0 3px var(--focus);
}

/* Segmented tab strip + sliding active pill (top bar on desktop, bottom bar on mobile). */
.cowoni-topbar .cowoni-site-tabs-shell,
.cowoni-bottombar .cowoni-site-tabs-shell {
  position: relative;
  isolation: isolate;
  width: 100%;
  max-width: 100%;
}

.cowoni-topbar .cowoni-site-tabs-shell::before,
.cowoni-bottombar .cowoni-site-tabs-shell::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  border-radius: 11px;
  background: rgba(118, 118, 128, 0.14);
  pointer-events: none;
}

.cowoni-topbar .cowoni-site-tabs__indicator,
.cowoni-bottombar .cowoni-site-tabs__indicator {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  pointer-events: none;
  border-radius: 8px;
  background-color: #ffffff;
  box-shadow: var(--shadow-surface);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
  transition:
    transform 0.45s cubic-bezier(0.32, 0.72, 0, 1),
    width 0.45s cubic-bezier(0.32, 0.72, 0, 1),
    height 0.45s cubic-bezier(0.32, 0.72, 0, 1),
    opacity 0.28s ease;
}

.cowoni-topbar .cowoni-site-tabs__indicator.cowoni-site-tabs__indicator--instant,
.cowoni-bottombar .cowoni-site-tabs__indicator.cowoni-site-tabs__indicator--instant {
  transition: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .cowoni-topbar .cowoni-site-tabs__indicator,
  .cowoni-bottombar .cowoni-site-tabs__indicator {
    transition: none !important;
  }
}

.cowoni-topbar .navbar-nav.cowoni-site-tabs,
.cowoni-bottombar .navbar-nav.cowoni-site-tabs {
  --cowoni-tab-track-inset: 4px;
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: var(--cowoni-tab-track-inset);
  padding: var(--cowoni-tab-track-inset);
  margin-bottom: 0;
  background: transparent;
  border-radius: 11px;
  width: 100%;
  max-width: 100%;
}

.cowoni-topbar .cowoni-site-tabs .nav-item,
.cowoni-bottombar .cowoni-site-tabs .nav-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}

.cowoni-topbar .cowoni-site-tabs__link.nav-link,
.cowoni-bottombar .cowoni-site-tabs__link.nav-link {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: rgba(60, 60, 67, 0.82);
  text-align: center;
  border: none;
  border-radius: 8px;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}

.cowoni-topbar .cowoni-site-tabs__link.nav-link.active,
.cowoni-bottombar .cowoni-site-tabs__link.nav-link.active {
  color: var(--text);
  font-weight: 600;
  background: transparent;
  box-shadow: none;
}

@media (hover: hover) and (pointer: fine) {
  .cowoni-topbar .cowoni-site-tabs__link.nav-link:hover,
  .cowoni-bottombar .cowoni-site-tabs__link.nav-link:hover {
    color: var(--text);
    background: rgba(255, 255, 255, 0.45);
  }

  .cowoni-topbar .cowoni-site-tabs__link.nav-link.active:hover,
  .cowoni-bottombar .cowoni-site-tabs__link.nav-link.active:hover {
    background: transparent;
    color: var(--text);
  }
}

.cowoni-topbar .cowoni-site-tabs__link.nav-link:focus-visible,
.cowoni-bottombar .cowoni-site-tabs__link.nav-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

@media (min-width: 768px) {
  .cowoni-topbar .cowoni-site-tabs-shell {
    width: auto;
    flex: 0 0 auto;
  }

  .cowoni-topbar .navbar-nav.cowoni-site-tabs {
    width: auto;
    flex: 0 0 auto;
  }

  .cowoni-topbar .cowoni-site-tabs .nav-item {
    flex: 0 0 auto;
  }

  .cowoni-topbar .cowoni-site-tabs__link.nav-link {
    flex: 0 0 auto;
    padding-left: 16px;
    padding-right: 16px;
    white-space: nowrap;
  }

  .cowoni-bottombar {
    display: none;
  }
}

/* Accent menu button + white bars (global `button` rules would paint it primary blue with a dark SVG icon). */
.cowoni-topbar .navbar-toggler {
  width: auto;
  max-width: none;
  padding: 0.5rem 0.85rem;
  background-color: var(--accent);
  border-radius: 999px;
  color: #fff;
}

.cowoni-topbar .navbar-toggler:focus-visible {
  background-color: var(--accent-hover);
  color: #fff;
}

@media (hover: hover) and (pointer: fine) {
  .cowoni-topbar .navbar-toggler:hover {
    background-color: var(--accent-hover);
    color: #fff;
  }
}

.cowoni-topbar .navbar-toggler:active {
  background-color: var(--accent-press);
  transform: none;
}

.cowoni-topbar .navbar-toggler-icon {
  width: 1.35em;
  height: 1.35em;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.95)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* Below `md`: hide top tabs, pin a separate bottom bar to the viewport. */
@media (max-width: 767.98px) {
  :root {
    --cowoni-topbar-inner: 56px;
    --cowoni-bottombar-content: 72px;
    --cowoni-bottombar-inner: var(--cowoni-bottombar-content);
    --cowoni-bottombar-gap: 20px;
  }

  .cowoni-topbar .navbar.navbar-expand-md {
    flex-wrap: nowrap;
    align-items: center;
    row-gap: 0;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
  }

  .cowoni-site-nav--top {
    display: none !important;
  }

  .cowoni-bottombar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 100;
    padding: 10px 14px calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--separator);
    background: rgba(245, 245, 247, 0.96);
    -webkit-backdrop-filter: var(--topbar-blur);
    backdrop-filter: var(--topbar-blur);
  }

  .cowoni-bottombar .cowoni-site-tabs__link.nav-link {
    padding: 7px 6px;
    font-size: 12px;
    letter-spacing: -0.01em;
  }

  html {
    scroll-padding-bottom: calc(
      var(--cowoni-bottombar-content) + env(safe-area-inset-bottom, 0px) + 20px
    );
  }
}

.cowoni-container {
  max-width: 720px;
}

.cowoni-dashboard-main {
  position: relative;
  z-index: 1;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--cowoni-topbar-inner) + 28px);
  padding-bottom: calc(
    72px + var(--cowoni-bottombar-content, var(--cowoni-bottombar-inner)) + env(safe-area-inset-bottom, 0px)
  );
}

/* iOS-style chrome — dashboard + landing (shared) */
.cowoni-page-dashboard .cowoni-backdrop,
.cowoni-page-landing .cowoni-backdrop {
  background: #f2f2f7;
}

.cowoni-page-dashboard.cowoni-app-body,
.cowoni-page-landing.cowoni-app-body {
  background: #f2f2f7;
}

.cowoni-page-dashboard .cowoni-dashboard-main {
  background: #f2f2f7;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--cowoni-topbar-inner) + 32px);
}

.cowoni-topbar--dashboard {
  background: rgba(242, 242, 247, 0.86);
  border-bottom-color: rgba(60, 60, 67, 0.12);
}

.cowoni-landing-main {
  position: relative;
  z-index: 1;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--cowoni-topbar-inner) + 32px);
  padding-bottom: calc(
    72px + var(--cowoni-bottombar-content, var(--cowoni-bottombar-inner)) + env(safe-area-inset-bottom, 0px)
  );
}

/* Legacy shell / hero (landing) */
.shell {
  max-width: 680px;
  margin: 0 auto;
  padding: 48px 22px 64px;
}

.page-head {
  margin-bottom: 28px;
}

.page-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: -0.022em;
  line-height: 1.15;
  color: #1d1d1f;
}

.page-tagline {
  margin: 4px 0 0;
  font-size: 15px;
  font-weight: 400;
  color: #86868b;
  letter-spacing: -0.01em;
}

.card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  padding: 0;
  margin-bottom: 14px;
  box-shadow: var(--shadow-surface);
  border: 1px solid var(--separator);
  overflow: hidden;
}

.card--hidden,
.is-hidden {
  display: none !important;
}

/* Settings — iOS grouped list (Settings.app style) */
.settings-ios {
  padding: 0 0 40px;
}

.settings-ios-compact {
  padding-bottom: 32px;
}

.settings-ios-page-title {
  margin: 0 0 4px;
  padding: 2px 2px 10px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.15;
  color: #000;
}

.settings-ios-compact .settings-ios-page-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
  padding-bottom: 8px;
}

.settings-ios-card--stack {
  margin-top: 0;
}

/* Full-width hairline between Settings sections (replaces easy-to-miss 0.5px divider divs). */
.settings-ios-card--stack > .settings-ios-stack-block:not(:first-child) > .settings-ios-disclosure > .settings-ios-row--disclosure {
  border-top: 0.5px solid rgba(60, 60, 67, 0.12);
}

.settings-ios-card {
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(60, 60, 67, 0.08);
  box-shadow: var(--shadow-surface);
}

.settings-ios-row {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 44px;
  margin: 0;
  padding: 10px 16px;
  font: inherit;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  text-align: left;
  color: #000;
  background: #fff;
  border: none;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.1s ease;
}

@media (hover: hover) and (pointer: fine) {
  .settings-ios-row:hover {
    background: rgba(118, 118, 128, 0.16);
  }
}

.settings-ios-row:active {
  background: rgba(118, 118, 128, 0.16);
}

/* List rows are <button>s; cancel global scale(0.98) so sections don’t “push in.” */
.settings-ios button:active {
  transform: none;
}

.settings-ios-row--disclosure {
  gap: 12px;
  cursor: pointer;
}

.settings-ios-row--disclosure[aria-expanded="true"] {
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
}

.settings-ios-row-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-weight: 400;
  font-size: inherit;
}

.settings-ios-row-title--flex {
  font-weight: 400;
}

/* In-panel subsection labels — match row title weight/size (e.g. Browser alerts / Pushover). */
.settings-ios-subsection-head {
  padding: 8px 16px 2px;
}

.settings-ios-compact .settings-ios-subsection-head {
  padding-left: 14px;
  padding-right: 14px;
}

.settings-ios-subsection-title {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #000;
}

.settings-ios-compact .settings-ios-subsection-title {
  font-size: 15px;
}

.settings-ios-subsection-title__link {
  color: inherit;
  text-decoration: none;
  font-weight: inherit;
}

@media (hover: hover) and (pointer: fine) {
  .settings-ios-subsection-title__link:hover {
    color: #007aff;
    text-decoration: underline;
  }
}

/* Web notifications: same block as Pushover title row (heading + trailing switch). */
.settings-ios-subsection-head--row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: default;
}

.settings-ios-subsection-head--row .settings-ios-subsection-title {
  flex: 1;
  min-width: 0;
}

/* Fixed box + centered ::before so only the glyph rotates (no layout shift). */
.settings-ios-chevron-disclosure {
  position: relative;
  display: block;
  width: 22px;
  height: 22px;
  margin-left: auto;
  flex-shrink: 0;
}

.settings-ios-chevron-disclosure::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 8px;
  height: 8px;
  box-sizing: border-box;
  border-right: 2px solid #c7c7cc;
  border-bottom: 2px solid #c7c7cc;
  transform: translate(-50%, -50%) rotate(-45deg);
  transform-origin: center center;
  transition: transform 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.settings-ios-row--disclosure[aria-expanded="true"] .settings-ios-chevron-disclosure::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.settings-ios-icon {
  width: 29px;
  height: 29px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: #8e8e93;
  color: #fff;
}

.settings-ios-subpanel {
  background: #fff;
  padding-bottom: 8px;
}

/* Match first-row top inset to Pushover block (separator + .settings-ios-pushover padding-top 4px + subsection-head 8px). */
#settings-panel-notifications.settings-ios-subpanel:not([hidden]) {
  padding-top: 4px;
}

.settings-ios-subpanel[hidden] {
  display: none !important;
}

/* Account: match top/bottom inset when signed out; when Log out is visible, drop bottom padding so the row isn’t followed by a white strip. */
.settings-ios-subpanel#settings-panel-account:not([hidden]) {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.settings-ios-subpanel#settings-panel-account:not([hidden]):has(#logout:not(.is-hidden)) {
  padding-bottom: 0;
}

.settings-ios-account-magic {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 0;
}

.settings-ios-account-lead {
  margin: 0;
  padding: 0 16px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(60, 60, 67, 0.55);
}

.settings-ios-compact .settings-ios-account-lead {
  padding-left: 14px;
  padding-right: 14px;
}

.settings-ios-account-form-inline {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.settings-ios-account-form-inline .settings-ios-text-field {
  flex: 1 1 200px;
  min-width: 0;
}

.settings-ios-account-form-inline > .settings-ios-pill-secondary {
  flex: 0 0 auto;
}

.settings-ios-account-magic-stack.settings-ios-account-form-inline {
  padding: 0 16px;
}

.settings-ios-compact .settings-ios-account-magic-stack {
  padding-left: 14px;
  padding-right: 14px;
}

.settings-ios-account-send {
  align-self: center;
}

.settings-ios-account-otp {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.settings-ios-account-otp-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 0 16px;
}

.settings-ios-compact .settings-ios-account-otp-notes {
  padding-left: 14px;
  padding-right: 14px;
}

.settings-ios-account-otp-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(60, 60, 67, 0.55);
}

.settings-ios-account-otp-form.settings-ios-inset-row.settings-ios-inset-row--tight {
  padding: 0 16px;
}

.settings-ios-compact .settings-ios-account-otp-form.settings-ios-inset-row.settings-ios-inset-row--tight {
  padding-left: 14px;
  padding-right: 14px;
}

#msg:empty {
  display: none;
}

.settings-ios-account-msg {
  margin: 0;
  padding: 0 16px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(60, 60, 67, 0.55);
}

.settings-ios-account-msg.bad {
  color: #ff3b30;
}

.settings-ios-account-msg.ok {
  color: #34c759;
}

.settings-ios-account-msg.muted {
  color: rgba(60, 60, 67, 0.55);
}

.settings-ios-compact .settings-ios-account-msg {
  padding-left: 14px;
  padding-right: 14px;
}

.settings-ios-footnote {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(60, 60, 67, 0.55);
}

.settings-ios-footnote--inset {
  padding: 10px 16px 8px;
}

.settings-ios-footnote--pad {
  padding: 8px 16px 0;
}

.settings-ios-footnote a {
  color: #007aff;
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .settings-ios-footnote a:hover {
    text-decoration: underline;
  }
}

.settings-ios-footnote strong {
  font-weight: 600;
  color: #000;
}

.settings-ios-muted {
  color: rgba(60, 60, 67, 0.45);
}

.settings-ios-inset-row {
  padding: 8px 16px 10px;
}

.settings-ios-inset-row--tight {
  padding-top: 6px;
  padding-bottom: 6px;
}

.settings-ios-inset-row--split {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.settings-ios-inset-row--split .settings-ios-text-field {
  flex: 1 1 160px;
  min-width: 0;
}

/* Field + actions on one row (desktop); stacked in the 520px media query below. */
.settings-ios-inset-row--token {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.settings-ios-inset-row--token > .settings-ios-text-field {
  flex: 1 1 200px;
  min-width: 0;
  width: auto;
  max-width: none;
}

.settings-ios-inset-row--token .settings-ios-inline-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.settings-ios-text-field {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 11px 14px;
  font-size: 16px;
  font-family: inherit;
  color: #000;
  background: rgba(118, 118, 128, 0.12);
  border: none;
  border-radius: 10px;
  outline: none;
}

.settings-ios-text-field:focus {
  box-shadow: 0 0 0 3px var(--focus);
}

/* API keys / tokens: monospace, same font-size as other Settings fields (16 / 15 compact). */
.settings-ios-text-field.settings-ios-field--secret {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  letter-spacing: -0.02em;
}

/* Mask like a password field; `type="password"` often hides script-set values in WebKit. */
.settings-ios-text-field.settings-ios-access-token--masked {
  -webkit-text-security: disc;
}

.settings-ios-text-field.settings-ios-access-token--plain {
  -webkit-text-security: none;
}

.settings-ios-row--link {
  justify-content: center;
  font-weight: 400;
  color: #007aff;
  border-top: 0.5px solid rgba(60, 60, 67, 0.12);
}

.settings-ios-row--destructive {
  justify-content: center;
  color: #ff3b30;
  border-top: 0.5px solid rgba(60, 60, 67, 0.12);
}

.settings-ios-pill-secondary {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  color: #007aff;
  background: rgba(0, 122, 255, 0.12);
  border: none;
  border-radius: 980px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.12s ease;
}

@media (hover: hover) and (pointer: fine) {
  .settings-ios-pill-secondary:hover {
    background: rgba(0, 122, 255, 0.18);
  }
}

.settings-ios-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Match width to the “Copy” pill so Show/Hide toggles and Save stay aligned. */
.settings-ios-inline-actions .settings-ios-pill-secondary {
  min-width: 5rem;
}

.settings-ios-separator-inset {
  height: 0.5px;
  margin: 8px 0 0;
  background: rgba(60, 60, 67, 0.12);
  border: none;
}

.settings-ios-separator-inset.settings-ios-account-otp-sep {
  margin: 0 16px;
}

.settings-ios-compact .settings-ios-separator-inset.settings-ios-account-otp-sep {
  margin-left: 14px;
  margin-right: 14px;
}

.settings-ios-row--switch {
  cursor: default;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 0.5px solid rgba(60, 60, 67, 0.12);
}

.settings-ios-row--switch .settings-ios-row-title,
.settings-ios-row--switch h3.settings-ios-row-title {
  margin: 0;
  font-size: inherit;
  font-weight: 400;
  line-height: 1.25;
}

@media (hover: hover) and (pointer: fine) {
  .settings-ios-row--switch:hover {
    background: #fff;
  }
}

.settings-ios-row--in-panel.settings-ios-row--switch {
  border-bottom: none;
  padding: 10px 16px;
}

.settings-ios-compact .settings-ios-row--in-panel.settings-ios-row--switch {
  padding: 8px 14px;
}

#webPushHint.settings-ios-notifications-foot:empty {
  display: none;
}

#settings-panel-notifications .web-push-homescreen-notice {
  margin: 0;
  padding: 6px 16px 0;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(60, 60, 67, 0.55);
}

.settings-ios-compact #settings-panel-notifications .web-push-homescreen-notice {
  padding-left: 14px;
  padding-right: 14px;
}

.settings-ios-card .settings-ios-separator-inset + .settings-ios-pushover {
  padding-top: 4px;
}

/* iOS-style switch */
.settings-ios-switch {
  position: relative;
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  cursor: pointer;
}

.settings-ios-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.settings-ios-switch-track {
  display: block;
  width: 51px;
  height: 31px;
  border-radius: 31px;
  background: #e9e9ea;
  transition: background 0.2s ease;
  position: relative;
}

.settings-ios-switch-track::after {
  content: "";
  position: absolute;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.12);
  transition: transform 0.22s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.settings-ios-switch input:checked + .settings-ios-switch-track {
  background: #34c759;
}

.settings-ios-switch input:checked + .settings-ios-switch-track::after {
  transform: translateX(20px);
}

.settings-ios-switch input:disabled + .settings-ios-switch-track {
  opacity: 0.45;
}

.settings-ios-switch input:focus-visible + .settings-ios-switch-track {
  box-shadow: 0 0 0 3px var(--focus);
}

.settings-ios-status {
  margin: 0;
  padding: 8px 16px 4px;
  font-size: 13px;
  line-height: 1.35;
  color: rgba(60, 60, 67, 0.5);
}

.settings-ios-status--pad {
  padding-top: 6px;
}

.settings-ios-status--tight {
  padding: 4px 16px 6px;
  font-size: 12px;
  line-height: 1.35;
}

/* Notifications panel: same vertical rhythm as subsection-head (2px bottom) + inset-row--tight (6px top). */
.settings-ios-notifications-foot {
  margin: 0;
  padding: 6px 16px 8px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(60, 60, 67, 0.5);
}

.settings-ios-compact .settings-ios-notifications-foot {
  padding-left: 14px;
  padding-right: 14px;
}

.settings-ios-notifications-foot.ok {
  color: #34c759;
}

.settings-ios-notifications-foot.bad {
  color: #ff3b30;
}

.settings-ios-notifications-foot.muted {
  color: rgba(60, 60, 67, 0.5);
}

.settings-ios-status.ok {
  color: #34c759;
}

.settings-ios-status.bad {
  color: #ff3b30;
}

.settings-ios-status.muted {
  color: rgba(60, 60, 67, 0.5);
}

.settings-ios-pushover {
  padding-bottom: 8px;
}

.settings-ios-pushover--tight {
  padding-bottom: 4px;
}

.settings-ios code {
  font-size: 0.9em;
  padding: 2px 6px;
  background: rgba(118, 118, 128, 0.14);
  border-radius: 5px;
}

.settings-ios-compact .settings-ios-row {
  min-height: 40px;
  padding: 8px 14px;
  font-size: 15px;
}

/* Main settings list (Account / Laptop / Notifications): same vertical inset top and bottom of card. */
.settings-ios-compact
  .settings-ios-card--stack
  > .settings-ios-stack-block
  > .settings-ios-disclosure
  > .settings-ios-row--disclosure {
  padding-top: 12px;
  padding-bottom: 12px;
}

.settings-ios-compact .settings-ios-footnote--inset {
  padding-top: 8px;
  padding-bottom: 4px;
  font-size: 12px;
}

.settings-ios-compact .settings-ios-text-field {
  padding: 10px 12px;
  font-size: 15px;
}

.settings-ios-compact .settings-ios-pill-secondary {
  padding: 8px 14px;
  font-size: 14px;
}

.settings-ios-compact .settings-ios-inline-actions .settings-ios-pill-secondary {
  min-width: 4.5rem;
}

.cowoni-field-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.row-token {
  align-items: stretch;
}

.row-token .mono {
  flex: 1 1 200px;
  min-width: 0;
}

.row-account-email {
  margin: 0;
}

.row-otp {
  margin: 0;
}

.notifications-stack .cowoni-field-row {
  margin-top: 0;
}

.notifications-stack .footnote,
.notifications-stack .settings-footnote {
  margin-top: 14px;
}

/* Status — hero card */
.status-panel {
  margin-bottom: 22px;
  padding: 22px 20px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--separator-strong);
  box-shadow: var(--shadow-surface);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

.status-panel-head {
  margin-bottom: 18px;
}

.status-panel__kicker {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subheading);
}

.status-panel__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.status-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.status-panel .status-tile {
  margin: 0;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--separator);
  background: rgba(245, 245, 247, 0.65);
  box-shadow: var(--shadow-surface);
  min-width: 0;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.status-panel .status-tile--good {
  border-color: rgba(52, 199, 89, 0.42);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.1), var(--shadow-surface);
}

.status-panel .status-tile--bad {
  border-color: rgba(255, 59, 48, 0.35);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 0 0 1px rgba(255, 59, 48, 0.08), var(--shadow-surface);
}

.status-panel .status-tile--neutral {
  border-color: var(--separator);
  background: rgba(245, 245, 247, 0.65);
}

.status-tile__main {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.status-tile__column {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.status-tile__icon-wrap {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  background: rgba(118, 118, 128, 0.12);
  color: rgba(60, 60, 67, 0.72);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.status-tile__icon-wrap svg {
  display: block;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.status-panel .status-tile--good .status-tile__icon-wrap {
  background: rgba(52, 199, 89, 0.14);
  color: #1f7a3d;
}

.status-panel .status-tile--bad .status-tile__icon-wrap {
  background: rgba(255, 59, 48, 0.12);
  color: #c41e16;
}

.status-tile__copy {
  min-width: 0;
  text-align: left;
}

.status-tile__eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--subheading);
}

.status-tile__value {
  margin: 0;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 1.15;
  min-height: 1.15em;
  color: var(--text);
}

.status-panel .status-tile__hint {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  color: rgba(60, 60, 67, 0.55);
}

.status-foot {
  margin-top: 16px;
  margin-bottom: 0;
  font-size: 12px;
  opacity: 0.9;
}

.status-foot--seen {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0 6px;
}

.status-history {
  margin-bottom: 22px;
  padding: 18px 20px 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--separator-strong);
  box-shadow: var(--shadow-surface);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

.status-history__head {
  margin-bottom: 12px;
}

.status-history__kicker {
  margin: 0 0 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subheading);
}

.status-history__title {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.status-history__chart-wrap {
  position: relative;
  border: 1px solid rgba(60, 60, 67, 0.12);
  border-radius: 12px;
  background: rgba(245, 245, 247, 0.58);
  overflow: hidden;
}

.status-history__chart {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 720 / 190;
  max-height: 190px;
}

.status-history__chart line {
  stroke: rgba(60, 60, 67, 0.18);
  stroke-width: 1;
}

.status-history__chart text {
  fill: rgba(60, 60, 67, 0.76);
  font-size: 11px;
  letter-spacing: -0.01em;
}

#statusHistoryOnlineLine {
  stroke: #007aff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#statusHistoryBatteryLine {
  stroke: #5ac8fa;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#statusHistoryHoverLine {
  stroke: rgba(29, 29, 31, 0.28);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
  pointer-events: none;
}

#statusHistoryHoverOnlineDot {
  fill: #007aff;
  stroke: #fff;
  stroke-width: 2;
  pointer-events: none;
}

#statusHistoryHoverBatteryDot {
  fill: #5ac8fa;
  stroke: #fff;
  stroke-width: 2;
  pointer-events: none;
}

#statusHistoryHoverOverlay {
  cursor: crosshair;
  touch-action: none;
}

.status-history__empty {
  position: absolute;
  inset: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  text-align: center;
  pointer-events: none;
}

.status-history__empty[hidden] {
  display: none;
}

.status-history__tooltip {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  min-width: 158px;
  max-width: min(220px, calc(100% - 12px));
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(60, 60, 67, 0.2);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.14);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  backdrop-filter: saturate(180%) blur(14px);
  font-size: 12px;
  line-height: 1.4;
  color: var(--text);
  pointer-events: none;
}

.status-history__tooltip[hidden] {
  display: none;
}

.status-history__tooltip-time {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.status-history__legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-secondary);
}

.status-history__axis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
  font-size: 11px;
  color: rgba(60, 60, 67, 0.62);
}

.status-history__axis span {
  display: block;
}

.status-history__axis span:first-child {
  text-align: left;
}

.status-history__axis span:not(:first-child):not(:last-child) {
  text-align: center;
}

.status-history__axis span:last-child {
  text-align: right;
}

.status-history__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.status-history__dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.status-history__dot--online {
  background: #007aff;
}

.status-history__dot--battery {
  background: #5ac8fa;
}

/* One pulse cycle per /status poll (period set in JS as --status-pulse-period) */
.status-seen-pulse {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34c759;
  box-shadow: 0 0 0 1px rgba(52, 199, 89, 0.35);
  opacity: 1;
  transform: scale(1);
}

.status-seen-pulse.status-seen-pulse--on {
  animation: cowoni-seen-pulse var(--status-pulse-period, 3s) ease-in-out infinite;
}

@keyframes cowoni-seen-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.2;
    transform: scale(0.82);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-seen-pulse.status-seen-pulse--on {
    animation: none;
    opacity: 0.85;
  }
}

input {
  max-width: 100%;
  min-width: 0;
  padding: 11px 14px;
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--separator-strong);
  border-radius: var(--radius-md);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

/* Grow only in horizontal toolbars — in column flex, flex-grow:1 stretches height (breaks Settings fields). */
.cowoni-field-row input:not([type="hidden"]) {
  flex: 1 1 200px;
  min-width: 0;
}

input::placeholder {
  color: #aeaeb2;
}

@media (hover: hover) and (pointer: fine) {
  input:hover:not(:read-only) {
    border-color: rgba(60, 60, 67, 0.28);
  }
}

input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--focus);
}

input.mono {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
}

/* Primary pill buttons only — not Settings rows, iOS pills, Bootstrap navbar toggler, `.secondary`, or the fixed feedback FAB. */
button:not(.settings-ios-row):not(.settings-ios-pill-secondary):not(.navbar-toggler):not(.secondary):not(.cowoni-feedback-fab):not(.widget-card__icon):not(.ext-add-btn) {
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 980px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    opacity 0.15s ease,
    color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  button:not(.settings-ios-row):not(.settings-ios-pill-secondary):not(.navbar-toggler):not(.secondary):not(.cowoni-feedback-fab):not(.widget-card__icon):not(.ext-add-btn):hover {
    background: var(--accent-hover);
    color: #fff;
  }
}

button:not(.settings-ios-row):not(.settings-ios-pill-secondary):not(.navbar-toggler):not(.secondary):not(.cowoni-feedback-fab):not(.widget-card__icon):not(.ext-add-btn):active {
  transform: scale(0.98);
  color: #fff;
  background: var(--accent-press);
}

button:not(.settings-ios-row):not(.settings-ios-pill-secondary):not(.navbar-toggler):not(.secondary):not(.cowoni-feedback-fab):not(.widget-card__icon):not(.ext-add-btn):disabled,
button:not(.settings-ios-row):not(.settings-ios-pill-secondary):not(.navbar-toggler):not(.secondary):not(.cowoni-feedback-fab):not(.widget-card__icon):not(.ext-add-btn):disabled:active {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  background: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  button:not(.settings-ios-row):not(.settings-ios-pill-secondary):not(.navbar-toggler):not(.secondary):not(.cowoni-feedback-fab):not(.widget-card__icon):not(.ext-add-btn):disabled:hover {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
    background: var(--accent);
  }
}

/* iOS pills: keep tinted surface + readable label (generic disabled uses solid accent + white, which clashes with pill text color). */
button.settings-ios-pill-secondary {
  color: #007aff;
  background: rgba(0, 122, 255, 0.12);
}

@media (hover: hover) and (pointer: fine) {
  button.settings-ios-pill-secondary:hover {
    color: #007aff;
    background: rgba(0, 122, 255, 0.18);
  }
}

button.settings-ios-pill-secondary:active {
  color: #007aff;
  background: rgba(0, 122, 255, 0.18);
  transform: none;
}

button.settings-ios-pill-secondary:disabled,
button.settings-ios-pill-secondary:disabled:active {
  opacity: 1;
  cursor: not-allowed;
  transform: none;
  background: rgba(118, 118, 128, 0.12);
  color: rgba(60, 60, 67, 0.45);
}

@media (hover: hover) and (pointer: fine) {
  button.settings-ios-pill-secondary:disabled:hover {
    opacity: 1;
    cursor: not-allowed;
    transform: none;
    background: rgba(118, 118, 128, 0.12);
    color: rgba(60, 60, 67, 0.45);
  }
}

button.secondary:disabled,
button.secondary:disabled:active {
  background: rgba(0, 113, 227, 0.1);
  color: var(--text-secondary);
}

@media (hover: hover) and (pointer: fine) {
  button.secondary:disabled:hover {
    background: rgba(0, 113, 227, 0.1);
    color: var(--text-secondary);
  }
}

.web-push-homescreen-notice {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 13px;
  line-height: 1.45;
}

/* Match desktop: base `button` includes `border: none` — Bootstrap + UA styles otherwise leave a border on <button.secondary>. */
button.secondary {
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.01em;
  color: var(--accent);
  background: rgba(0, 113, 227, 0.1);
  border: none;
  border-radius: 980px;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  box-shadow: none;
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    opacity 0.15s ease,
    color 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
  button.secondary:hover {
    background: rgba(0, 113, 227, 0.16);
    color: var(--accent);
  }
}

button.secondary:active {
  transform: scale(0.98);
  color: var(--accent);
  background: rgba(0, 113, 227, 0.24);
}

/* Landing CTAs — avoid Bootstrap’s `.btn` (it overrides colors/backgrounds on <a>). */
a.landing-btn,
a.landing-btn:visited {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.01em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: 980px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    color 0.15s ease;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) and (pointer: fine) {
  a.landing-btn:hover {
    background: var(--accent-hover);
    color: #fff;
  }
}

a.landing-btn:active {
  transform: scale(0.98);
  color: #fff;
  background: var(--accent-press);
}

a.landing-btn--secondary,
a.landing-btn--secondary:visited {
  color: var(--accent);
  background: rgba(0, 113, 227, 0.1);
}

@media (hover: hover) and (pointer: fine) {
  a.landing-btn--secondary:hover {
    background: rgba(0, 113, 227, 0.16);
    color: var(--accent);
  }
}

a.landing-btn--secondary:active {
  transform: scale(0.98);
  color: var(--accent);
  background: rgba(0, 113, 227, 0.24);
}

.muted {
  color: var(--text-secondary);
}

.prose {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
}

.prose strong {
  font-weight: 600;
  color: var(--text);
}

.prose a {
  color: var(--accent);
  text-decoration: none;
}

@media (hover: hover) and (pointer: fine) {
  .prose a:hover {
    text-decoration: underline;
  }
}

.footnote {
  margin: 12px 0 0;
  font-size: 13px;
}

.footnote.account-msg,
.settings-footnote.account-msg {
  margin-top: 0;
}

.ok {
  color: #34c759;
}

.bad {
  color: #ff3b30;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  padding: 2px 6px;
  background: rgba(60, 60, 67, 0.08);
  border-radius: 6px;
}

pre {
  background: #1c1c1e;
  color: #ebebf5;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  overflow: auto;
  font-size: 12px;
  line-height: 1.5;
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
}

/* Landing hero (index.html) — matches status / settings card language */
.hero-card {
  margin: 0;
  padding: 22px 20px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--separator-strong);
  box-shadow: var(--shadow-surface);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

.hero-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--subheading);
}

.hero-title {
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
  color: var(--text);
}

.hero-subtitle {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.beta-access-form input:not([type="hidden"]) {
  flex: 1 1 200px;
  min-width: 0;
}

.beta-access-error {
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: #ff3b30;
}

.beta-access-notice-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 0 0 20px;
}

.beta-access-notice {
  margin: 0;
  padding: 14px 16px;
  border-radius: 12px;
  background: rgba(60, 60, 67, 0.06);
  border: 1px solid rgba(60, 60, 67, 0.12);
}

.beta-access-notice__title {
  margin: 0 0 8px;
  padding: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  color: var(--subheading, var(--text-secondary));
}

.beta-access-notice__body {
  font-size: 13px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

.beta-access-notice__body p {
  margin: 0 0 8px;
}

.beta-access-notice__body p:last-child {
  margin-bottom: 0;
}

.beta-access-notice__body strong {
  color: inherit;
  font-weight: 600;
}

.hero-footnote {
  margin: 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.hero-footnote code {
  background: rgba(60, 60, 67, 0.08);
  padding: 2px 6px;
  border-radius: 6px;
}

/* Landing: stacked sections below hero (matches dashboard card gap). */
.cowoni-landing-section {
  margin-top: 22px;
}

/* Landing: same shell as dashboard Settings (no nested hero-card). */
.cowoni-landing-settings-block.settings-ios.settings-ios-compact {
  padding: 0;
}

/* Grouped list + disclosure rows (reuse Settings styles). */
.cowoni-landing-accordion-card {
  width: 100%;
  margin: 0;
  box-sizing: border-box;
}

.cowoni-landing-accordion-card .settings-ios-row--disclosure {
  align-items: center;
  min-height: 52px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.cowoni-landing-disclosure-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  flex: 1;
  min-width: 0;
  text-align: left;
}

.cowoni-landing-disclosure-eyebrow {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  line-height: 1.2;
  color: rgba(60, 60, 67, 0.55);
}

.cowoni-landing-disclosure-title {
  margin: 0;
  font-size: 16px;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #000;
}

.cowoni-landing-disclosure-panel {
  padding: 4px 16px 16px;
}

.cowoni-landing-disclosure-panel .hero-subtitle {
  margin-top: 4px;
}

.cowoni-landing-disclosure-panel .cowoni-setup-steps {
  margin-top: 4px;
}

/* Landing “Get started” — icon markers + readable scan lines */
.hero-subtitle.cowoni-setup-intro {
  margin-bottom: 22px;
}

.cowoni-setup-steps {
  margin: 0;
  padding: 0;
  list-style: none;
}

.cowoni-setup-step {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin: 0;
  padding: 0 0 26px;
  border-bottom: 0.5px solid var(--separator);
}

.cowoni-setup-step:not(:first-child) {
  padding-top: 26px;
}

.cowoni-setup-step:first-child {
  padding-top: 0;
}

.cowoni-setup-step:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.cowoni-setup-step__marker {
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(118, 118, 128, 0.12);
  color: rgba(60, 60, 67, 0.88);
}

.cowoni-setup-step__icon {
  display: block;
}

.cowoni-setup-step__body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.cowoni-setup-step__title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cowoni-setup-step__detail {
  margin: 0;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

.cowoni-setup-steps a,
.cowoni-setup-intro a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 400;
  border-radius: 4px;
  -webkit-tap-highlight-color: transparent;
}

.cowoni-setup-steps a:focus-visible,
.cowoni-setup-intro a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--focus);
}

@media (hover: hover) and (pointer: fine) {
  .cowoni-setup-steps a:hover,
  .cowoni-setup-intro a:hover {
    text-decoration: underline;
  }
}

.video-container {
  position: relative;
  width: 100%;
  margin-top: 18px;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(118, 118, 128, 0.08);
}

.video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.hero-subtitle.cowoni-updates-intro {
  margin-bottom: 18px;
}

.cowoni-landing-releases {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cowoni-landing-release {
  margin: 0;
  padding: 0 0 22px;
  border-bottom: 0.5px solid var(--separator);
}

.cowoni-landing-release:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.cowoni-landing-release__version {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cowoni-landing-release__date {
  margin: 0 0 10px;
  font-size: 13px;
  line-height: 1.35;
  color: var(--subheading);
}

.cowoni-landing-release__list {
  margin: 0;
  padding-left: 1.15em;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
}

.cowoni-landing-release__list li {
  margin: 0 0 6px;
}

.cowoni-landing-release__list li:last-child {
  margin-bottom: 0;
}

@media (max-width: 520px) {
  .cowoni-dashboard-main {
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--cowoni-topbar-inner) + 20px);
    padding-bottom: calc(
      20px + var(--cowoni-bottombar-content, 0px) + env(safe-area-inset-bottom, 0px)
    );
  }

  .cowoni-page-dashboard .cowoni-dashboard-main {
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--cowoni-topbar-inner) + 24px);
  }

  .cowoni-landing-main {
    padding-top: calc(env(safe-area-inset-top, 0px) + var(--cowoni-topbar-inner) + 24px);
    padding-bottom: calc(
      20px + var(--cowoni-bottombar-content, 0px) + env(safe-area-inset-bottom, 0px)
    );
  }

  .shell {
    padding: 32px 16px 48px;
  }

  .page-title {
    font-size: 24px;
  }

  .status-hero {
    grid-template-columns: 1fr;
  }

  .status-panel {
    padding: 20px 16px 16px;
    border-radius: 18px;
  }

  .status-history {
    padding: 16px;
    border-radius: 16px;
  }

  .status-history__title {
    font-size: 17px;
  }

  .status-panel__title {
    font-size: 17px;
  }

  .status-history__chart text {
    font-size: 9px;
  }

  .status-history__axis {
    font-size: 10px;
  }

  .status-tile__value {
    font-size: 22px;
  }

  button:not(.navbar-toggler):not(.settings-ios-pill-secondary):not(.settings-ios-row):not(.cowoni-feedback-popover__action):not(.cowoni-feedback-fab):not(.widget-card__icon):not(.ext-add-btn),
  input {
    width: 100%;
  }

  .cowoni-field-row button {
    width: auto;
    flex: 1 1 auto;
  }

  .settings-ios-account-form-inline {
    flex-direction: column;
    align-items: stretch;
  }

  /* Column flex: flex-grow on the main axis is vertical — disable grow so fields stay single-line height. */
  .settings-ios-account-form-inline .settings-ios-text-field {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  .settings-ios-inset-row--split .settings-ios-text-field {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  .settings-ios-inset-row--token > .settings-ios-text-field {
    flex: 0 0 auto;
    width: 100%;
    max-width: 100%;
  }

  .settings-ios-account-form-inline > .settings-ios-pill-secondary {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }

  .settings-ios-account-send {
    align-self: stretch;
  }

  .settings-ios-inset-row--split {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-ios-inset-row--split > .settings-ios-pill-secondary {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }

  .settings-ios-inset-row--token {
    flex-direction: column;
    align-items: stretch;
  }

  .settings-ios-inset-row--token .settings-ios-inline-actions {
    width: 100%;
  }

  /* Equal-width columns (flex-basis 0); content-based flex broke Show/Hide width on narrow viewports. */
  .settings-ios-inset-row--token .settings-ios-inline-actions .settings-ios-pill-secondary,
  .settings-ios-inline-actions .settings-ios-pill-secondary {
    flex: 1 1 0;
    min-width: min(5rem, 100%);
    max-width: 100%;
    width: auto;
    box-sizing: border-box;
    justify-content: center;
  }

  .settings-ios-compact .settings-ios-inset-row--token .settings-ios-inline-actions .settings-ios-pill-secondary,
  .settings-ios-compact .settings-ios-inline-actions .settings-ios-pill-secondary {
    min-width: min(4.5rem, 100%);
  }

  .hero-card {
    padding: 20px 16px 16px;
    border-radius: 18px;
  }

  .hero-title {
    font-size: 20px;
  }

  .cowoni-setup-step__marker {
    width: 40px;
    height: 40px;
    border-radius: 10px;
  }

  .cowoni-setup-step__icon {
    width: 20px;
    height: 20px;
  }

  .cowoni-setup-step__title,
  .cowoni-setup-step__detail {
    font-size: 14px;
  }

  .cowoni-setup-step {
    gap: 12px;
    padding-bottom: 22px;
  }

  .cowoni-setup-step:not(:first-child) {
    padding-top: 22px;
  }
}

/* Beta feedback (dashboard, signed-in) — matches hero-card / settings surfaces */
.cowoni-feedback-fab {
  position: fixed;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 1080;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--separator-strong);
  background: rgba(255, 255, 255, 0.82);
  color: var(--accent);
  font-weight: 650;
  font-size: 14px;
  letter-spacing: -0.01em;
  box-shadow: var(--shadow-surface);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  cursor: pointer;
}

.cowoni-feedback-fab__icon {
  display: inline-flex;
  line-height: 0;
}

.cowoni-feedback-fab:hover {
  background: rgba(0, 113, 227, 0.08);
}

.cowoni-feedback-fab:active {
  background: rgba(0, 113, 227, 0.14);
  transform: translateY(1px);
}

@media (max-width: 767.98px) {
  .cowoni-feedback-fab {
    bottom: calc(
      var(--cowoni-bottombar-content, 72px) + env(safe-area-inset-bottom, 0px) + var(--cowoni-bottombar-gap, 20px)
    );
  }

  .cowoni-feedback-popover {
    padding-bottom: calc(
      var(--cowoni-bottombar-content, 72px) + env(safe-area-inset-bottom, 0px) + 20px
    );
  }
}

.cowoni-feedback-popover {
  position: fixed;
  inset: 0;
  z-index: 1090;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
}

@media (min-width: 600px) {
  .cowoni-feedback-popover {
    align-items: center;
    padding: 24px;
  }
}

.cowoni-feedback-popover__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  pointer-events: auto;
}

.cowoni-feedback-popover__panel {
  position: relative;
  width: min(100%, 440px);
  max-height: min(85vh, 520px);
  overflow: auto;
  margin-bottom: env(safe-area-inset-bottom, 0);
  padding: 20px 18px 18px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--separator-strong);
  box-shadow: var(--shadow-surface), 0 24px 60px rgba(0, 0, 0, 0.12);
  pointer-events: auto;
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
}

.cowoni-feedback-popover__title {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 650;
  letter-spacing: -0.02em;
  color: var(--text);
}

.cowoni-feedback-popover__hint {
  margin: 0 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.cowoni-feedback-popover__meta {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin: -6px 0 14px;
}

.cowoni-feedback-popover__meta-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.cowoni-feedback-popover__meta-toggle.is-hidden {
  display: none;
}

.cowoni-feedback-popover__meta-toggle input {
  accent-color: var(--accent);
  width: 16px;
  height: 16px;
}

.cowoni-feedback-popover__field-label {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--subheading);
}

.cowoni-feedback-popover__types {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.cowoni-feedback-popover__type {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--separator);
  background: rgba(255, 255, 255, 0.65);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  cursor: pointer;
  user-select: none;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    box-shadow 0.15s ease;
}

.cowoni-feedback-popover__type:hover {
  border-color: var(--separator-strong);
}

.cowoni-feedback-popover__type:has(input:checked) {
  border-color: rgba(0, 113, 227, 0.45);
  background: rgba(0, 113, 227, 0.08);
  box-shadow: 0 0 0 1px rgba(0, 113, 227, 0.12);
}

.cowoni-feedback-popover__type:has(input:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.cowoni-feedback-popover__type input {
  accent-color: var(--accent);
}

.cowoni-feedback-popover__textarea {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  padding: 11px 13px;
  font-size: 15px;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--text);
  background: rgba(255, 255, 255, 0.9);
  border-radius: var(--radius-md);
  border: 1px solid var(--separator);
  outline: none;
}

.cowoni-feedback-popover__textarea:focus {
  border-color: rgba(0, 113, 227, 0.45);
  box-shadow: 0 0 0 3px var(--focus);
}

.cowoni-feedback-popover__status {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.35;
}

.cowoni-feedback-popover__status.is-hidden {
  display: none;
}

.cowoni-feedback-popover__status--muted {
  color: rgba(60, 60, 67, 0.72);
}

.cowoni-feedback-popover__status--bad {
  color: #ff3b30;
}

.cowoni-feedback-popover__status--ok {
  color: #34c759;
}

.cowoni-feedback-popover__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

/* Same pill radius as the desktop app (`border-radius: 999px`); dashboard globals use 980px. */
.cowoni-feedback-popover__actions .cowoni-feedback-popover__action {
  border-radius: 999px;
}

/* ---------------------------------------------------------------------------
   QR Code Cross-Device Authentication
   Independent from the existing email-link auth styles above.
   --------------------------------------------------------------------------- */

/* QR panel container inside the settings subpanel */
.qr-auth-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  /* Match the same in-panel horizontal rhythm as other settings content. */
  padding: 14px 16px 0;
  gap: 10px;
}

/* QR code canvas / image wrapper */
.qr-code-wrap {
  width: 180px;
  height: 180px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
  overflow: hidden;
  position: relative;
}

/* qrcode.js renders a table or canvas; make sure it fits */
.qr-code-wrap img,
.qr-code-wrap canvas {
  display: block;
  width: 176px !important;
  height: 176px !important;
}

.qr-loading-placeholder {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  padding: 8px;
}

.qr-error-text {
  color: #ff3b30;
}

#qrStatus:empty {
  display: none;
}

.qr-fallback-url {
  font-size: 10px;
  word-break: break-all;
  color: var(--text-secondary);
  padding: 8px;
  text-align: center;
  line-height: 1.4;
}

/* Countdown timer below QR code */
.qr-countdown {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: center;
  min-height: 16px;
}

/* Refresh button */
.qr-refresh-btn {
  font-size: 13px;
}

/* Keep QR block spacing balanced when no status message is shown. */
#qrStatus:empty {
  display: none;
}

/* ---------------------------------------------------------------------------
   QR Auth — host confirmation dialog (modal overlay)
   --------------------------------------------------------------------------- */

.qr-confirm-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0 16px 32px;
}

@media (min-width: 480px) {
  .qr-confirm-overlay {
    align-items: center;
    padding: 24px;
  }
}

.qr-confirm-overlay[hidden] {
  display: none;
}

.qr-confirm-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 0;
}

.qr-confirm-card {
  position: relative;
  z-index: 1;
  background: var(--bg-elevated, #fff);
  border-radius: 20px;
  padding: 28px 24px 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
  text-align: center;
}

.qr-confirm-icon {
  color: var(--accent, #0071e3);
  margin-bottom: 14px;
}

.qr-confirm-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text, #1d1d1f);
  margin-bottom: 8px;
}

.qr-confirm-desc {
  font-size: 14px;
  color: var(--text-secondary, #86868b);
  line-height: 1.5;
  margin-bottom: 18px;
}

.qr-confirm-msg {
  font-size: 13px;
  color: var(--text-secondary, #86868b);
  min-height: 18px;
  margin-bottom: 6px;
}

.qr-confirm-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.qr-confirm-btn {
  flex: 1;
  width: 100%;
}

.qr-confirm-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

.qr-confirm-btn--deny {
  /* Intentionally inherit the standard Cowoni pill design. */
  background: unset;
  color: unset;
}

.qr-confirm-btn--allow {
  /* Intentionally inherit the standard Cowoni pill design. */
  background: unset;
  color: unset;
}

@media (hover: hover) and (pointer: fine) {
  /* hover handled by `.settings-ios-pill-secondary:hover` */
}

/* active handled by `.settings-ios-pill-secondary:active` */

/* Laptop Client onboarding (auto-link) — see link-extension.js */

/* Status chip in the section header. */
.ext-link-pill {
  margin-left: auto;
  margin-right: 8px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.ext-link-pill--muted {
  color: var(--text-secondary);
  background: rgba(60, 60, 67, 0.08);
}

.ext-link-pill--info {
  color: var(--accent);
  background: rgba(0, 113, 227, 0.12);
}

.ext-link-pill--good {
  color: #248a3d;
  background: rgba(52, 199, 89, 0.16);
}

.ext-link-pill--warn {
  color: #b25000;
  background: rgba(255, 149, 0, 0.16);
}

#settings-toggle-extension .settings-ios-row-title {
  margin-right: 8px;
}

/* Hide the status line when it has no message (e.g. in fallback mode). */
#extStatus:empty {
  display: none;
}

.ext-link-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px 16px 2px;
}

/* Add to Chrome button (also used for widgets-page primary actions). */
.ext-add-btn,
a.ext-add-btn,
button.ext-add-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border-radius: 980px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  font-family: inherit;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: none;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition:
    background 0.15s ease,
    transform 0.1s ease,
    color 0.15s ease;
}

.ext-add-btn__icon {
  display: inline-flex;
}

@media (hover: hover) and (pointer: fine) {
  .ext-add-btn:hover,
  a.ext-add-btn:hover,
  button.ext-add-btn:hover {
    background: var(--accent-hover);
    color: #fff;
  }
}

.ext-add-btn:active,
a.ext-add-btn:active,
button.ext-add-btn:active {
  transform: scale(0.98);
  background: var(--accent-press);
  color: #fff;
}

button.ext-add-btn:disabled,
button.ext-add-btn:disabled:active {
  opacity: 0.48;
  cursor: not-allowed;
  transform: none;
  background: var(--accent);
}

@media (hover: hover) and (pointer: fine) {
  button.ext-add-btn:disabled:hover {
    opacity: 0.48;
    cursor: not-allowed;
    transform: none;
    background: var(--accent);
  }
}

.ext-add-btn:focus-visible,
a.ext-add-btn:focus-visible,
button.ext-add-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* [hidden] must beat the inline-flex display these controls set. */
.ext-add-btn[hidden],
#extRetryBtn[hidden] {
  display: none;
}

/* Keep Show / Copy / Retry on one line, wrapping only if cramped. */
#settings-panel-extension .settings-ios-inline-actions {
  flex-wrap: wrap;
}

/* On mobile there is no extension to install, so hide the auto-link UI and
 * show only the access token (link-extension.js adds .ext-is-mobile). The token
 * label is desktop-redundant with the status line, so it is mobile-only. */
.ext-is-mobile .ext-auto-only {
  display: none;
}

.ext-mobile-only {
  display: none;
}

.ext-is-mobile .ext-mobile-only {
  display: block;
}

/* The access-token form is a fallback: hidden until auto-linking fails
 * (.ext-fallback, set by link-extension.js), always shown on mobile. */
.ext-token {
  display: none;
}

.ext-fallback .ext-token,
.ext-is-mobile .ext-token {
  display: block;
}

.settings-ios-compact .ext-link-actions {
  padding-left: 14px;
  padding-right: 14px;
}
