:root {
  color-scheme: light;
  --background: #f5f5f7;
  --surface: #fff;
  --surface-soft: #fafafa;
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #8e8e93;
  --line: #e9e9ed;
  --blue: #007aff;
  --blue-soft: #e8f2ff;
  --glass: rgb(255 255 255 / 82%);
  --shadow: 0 20px 55px rgb(30 35 50 / 6%);
  --keyboard-offset: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --background: #000;
    --surface: #1c1c1e;
    --surface-soft: #252528;
    --ink: #f5f5f7;
    --muted: #aeaeb2;
    --faint: #8e8e93;
    --line: #353539;
    --blue: #0a84ff;
    --blue-soft: #0c2c4d;
    --glass: rgb(29 29 31 / 88%);
    --shadow: 0 20px 55px rgb(0 0 0 / 28%);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --background: #000;
  --surface: #1c1c1e;
  --surface-soft: #252528;
  --ink: #f5f5f7;
  --muted: #aeaeb2;
  --faint: #8e8e93;
  --line: #353539;
  --blue: #0a84ff;
  --blue-soft: #0c2c4d;
  --glass: rgb(29 29 31 / 88%);
  --shadow: 0 20px 55px rgb(0 0 0 / 28%);
}

*, *::before, *::after { box-sizing: border-box; }
html { background: var(--background); scroll-behavior: smooth; }
body { margin: 0; min-width: 280px; background: var(--background); color: var(--ink); }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
::selection { background: var(--blue-soft); }

.app-shell { min-height: 100dvh; }
.page-content { width: min(100% - 40px, 920px); margin: 0 auto; padding: calc(48px + env(safe-area-inset-top)) 0 calc(152px + env(safe-area-inset-bottom)); outline: 0; }
.page-heading { margin: 0 0 32px; }
.eyebrow, .section-kicker { margin: 0; color: var(--blue); font-size: 11px; font-weight: 750; letter-spacing: .15em; text-transform: uppercase; }
.page-heading h1 { max-width: 750px; margin: 11px 0 0; font-size: clamp(30px, 5vw, 42px); line-height: 1.16; letter-spacing: -.045em; font-weight: 760; }
.page-subtitle { margin: 12px 0 0; color: var(--muted); font-size: 16px; line-height: 1.5; }

.hero-card { position: relative; display: flex; min-height: 260px; overflow: hidden; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); }
.hero-copy { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: flex-start; padding: 34px 38px; }
.hero-number { margin-top: 13px; font-size: clamp(74px, 10vw, 104px); line-height: .95; letter-spacing: -.08em; font-weight: 740; }
.hero-unit { margin-top: 8px; font-size: 18px; font-weight: 650; }
.hero-copy p { max-width: 275px; margin: 18px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.hero-art { position: absolute; right: 3%; bottom: -16px; width: 47%; height: 235px; }
.art-laptop { position: absolute; right: 0; bottom: 10px; width: 100%; height: 74%; padding: 8px; border: 5px solid #b8bcc4; border-radius: 15px 15px 8px 8px; background: #3b4350; transform: rotate(-8deg); box-shadow: 0 24px 35px rgb(0 0 0 / 17%); }
.art-laptop div { width: 100%; height: 100%; border-radius: 4px; background: linear-gradient(135deg, #dce8f5, #8abbe8 62%, #4c7cae); }
.art-laptop::after { content: ""; position: absolute; left: -10%; bottom: -12px; width: 120%; height: 9px; border-radius: 0 0 50% 50%; background: #b8bcc4; }
.art-phone { position: absolute; right: 5%; bottom: 0; width: 85px; height: 165px; padding: 5px; border: 5px solid #555b67; border-radius: 20px; background: #242b35; transform: rotate(9deg); box-shadow: 0 14px 24px rgb(0 0 0 / 20%); }
.art-phone div { width: 100%; height: 100%; border-radius: 11px; background: linear-gradient(155deg, #dce8f5, #85b8e9 70%, #4c7cae); }
.art-phone::before { content: ""; position: absolute; z-index: 1; top: 7px; left: 50%; width: 24px; height: 6px; transform: translateX(-50%); border-radius: 10px; background: #242b35; }

.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 35px 0 14px; }
.section-title h2, .settings-section h2 { margin: 0; font-size: 20px; line-height: 1.3; letter-spacing: -.025em; }
.section-title > span { color: var(--faint); font-size: 13px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; min-height: 150px; flex-direction: column; align-items: flex-start; padding: 22px; border-radius: 22px; background: var(--surface); }
.stat-value { overflow-wrap: anywhere; font-size: clamp(26px, 3vw, 35px); font-weight: 720; line-height: 1.1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.stat-label { margin-top: 18px; font-size: 14px; font-weight: 650; }
.stat-note { margin-top: 3px; color: var(--faint); font-size: 12px; }
.action-row { display: flex; min-height: 88px; align-items: center; gap: 16px; padding: 16px 22px; border-radius: 22px; background: var(--surface); transition: transform 220ms ease, box-shadow 220ms ease; }
.action-row:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.action-row > span:nth-child(2) { display: flex; flex: 1; min-width: 0; flex-direction: column; gap: 4px; }
.action-row strong { font-size: 15px; }
.action-row small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.action-icon, .empty-icon { display: grid; flex: none; place-items: center; color: var(--blue); background: var(--blue-soft); }
.action-icon { width: 48px; height: 48px; border-radius: 15px; }
.chevron { color: var(--faint); font-size: 25px; line-height: 1; }
.quiet-card { margin-top: 14px; padding: 23px 26px; border-radius: 22px; background: var(--surface); }
.quiet-card p { margin: 11px 0 0; color: var(--muted); font-size: 14px; line-height: 1.6; }

.empty-card { display: flex; min-height: 360px; flex-direction: column; align-items: center; justify-content: center; padding: 40px 24px; border-radius: 28px; background: var(--surface); text-align: center; }
.empty-icon { width: 74px; height: 74px; border-radius: 23px; }
.empty-icon .icon { width: 35px; height: 35px; }
.empty-card h2 { margin: 24px 0 0; font-size: 23px; letter-spacing: -.03em; }
.empty-card p { max-width: 300px; margin: 10px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.phase-note { margin-top: 22px; padding: 8px 13px; border-radius: 100px; color: var(--muted); background: var(--background); font-size: 12px; font-weight: 650; }

.settings-section { margin-top: 32px; }
.settings-section h2 { margin: 0 0 13px; }
.settings-card { padding: 23px; border-radius: 22px; background: var(--surface); }
.setting-intro { display: flex; flex-direction: column; gap: 4px; }
.setting-intro strong { font-size: 16px; }
.setting-intro small { color: var(--muted); font-size: 13px; }
.theme-choice { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; margin-top: 21px; padding: 5px; border-radius: 15px; background: var(--background); }
.theme-button { min-height: 46px; padding: 8px 4px; border: 0; border-radius: 11px; color: var(--muted); background: transparent; cursor: pointer; font-size: 14px; font-weight: 650; transition: background 220ms ease, color 220ms ease, box-shadow 220ms ease; }
.theme-button.selected { color: var(--blue); background: var(--surface); box-shadow: 0 2px 8px rgb(0 0 0 / 7%); }
.theme-button:hover:not(.selected) { color: var(--ink); }
.setting-list { padding: 0 22px; }
.setting-row { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); font-size: 14px; }
.setting-row:last-child { border-bottom: 0; }
.setting-row strong { font-size: 13px; font-weight: 600; text-align: right; }
.setting-row .muted, .settings-footnote { color: var(--muted); }
.settings-footnote { margin: 12px 5px 0; font-size: 12px; line-height: 1.55; }

.tabbar { position: fixed; z-index: 10; bottom: calc(16px + env(safe-area-inset-bottom)); left: 50%; display: flex; width: min(calc(100% - 32px), 410px); align-items: stretch; padding: 6px; transform: translateX(-50%); border: 1px solid var(--line); border-radius: 23px; background: var(--glass); box-shadow: 0 15px 35px rgb(0 0 0 / 11%); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
.tab { display: flex; min-width: 0; min-height: 54px; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: 17px; color: var(--muted); font-size: 11px; font-weight: 620; transition: background 220ms ease, color 220ms ease; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--blue); background: var(--surface); }
.icon { display: inline-block; width: 22px; height: 22px; flex: none; background: currentColor; -webkit-mask-position: center; mask-position: center; -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-size: contain; mask-size: contain; }
.icon-overview { -webkit-mask-image: url('../assets/overview.svg'); mask-image: url('../assets/overview.svg'); }
.icon-devices { -webkit-mask-image: url('../assets/devices.svg'); mask-image: url('../assets/devices.svg'); }
.icon-records { -webkit-mask-image: url('../assets/records.svg'); mask-image: url('../assets/records.svg'); }
.icon-settings { -webkit-mask-image: url('../assets/settings.svg'); mask-image: url('../assets/settings.svg'); }

@media (max-width: 680px) {
  .page-content { width: min(100% - 36px, 520px); padding-top: calc(34px + env(safe-area-inset-top)); }
  .page-heading { margin-bottom: 25px; }
  .page-heading h1 { font-size: clamp(30px, 7vw, 36px); }
  .hero-card { min-height: 245px; }
  .hero-copy { padding: 27px; }
  .hero-art { display: none; }
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { min-height: 124px; padding: 19px; }
  .stat-label { margin-top: 14px; }
}

@media (max-width: 390px) {
  .hero-copy p { max-width: 250px; }
  .stat-value { font-size: 28px; }
  .tabbar { width: calc(100% - 24px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media (prefers-reduced-transparency: reduce) {
  .tabbar, .detail-topbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (forced-colors: active) {
  .tabbar, .detail-topbar, .device-hero-card, .hero-card, .stat, .empty-card, .settings-card { border: 1px solid CanvasText; }
  .tab.active, .theme-button.selected { outline: 2px solid Highlight; }
}

/* Stage two keeps the first-stage surfaces and adds functional lists and sheets. */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.page-heading-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading-row .primary-button { margin-bottom: 3px; }
.primary-button, .secondary-button, .destructive-button { display: inline-flex; min-height: 48px; align-items: center; justify-content: center; gap: 6px; padding: 11px 18px; border: 0; border-radius: 14px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 680; text-align: center; transition: transform 200ms ease, background 200ms ease, opacity 200ms ease; }
.primary-button:hover, .secondary-button:hover, .destructive-button:hover { transform: translateY(-1px); }
.primary-button:disabled, .secondary-button:disabled, .destructive-button:disabled { opacity: .5; cursor: wait; transform: none; }
.primary-button { color: #fff; background: var(--blue); }
.secondary-button { color: var(--blue); background: var(--blue-soft); }
.destructive-button { color: #fff; background: #c93535; }
.text-button, .back-link, .serial-toggle { display: inline-flex; min-height: 44px; align-items: center; border: 0; color: var(--blue); background: transparent; cursor: pointer; font: inherit; font-size: 14px; font-weight: 650; }
.text-button { margin-top: 12px; }
.back-link { margin: -18px 0 8px; }
.result-count { margin: 15px 4px 12px; color: var(--muted); font-size: 13px; }
.filter-card { display: flex; gap: 10px; padding: 11px; border-radius: 20px; background: var(--surface); }
.search-field { flex: 1; min-width: 0; }
.category-field { width: 165px; flex: none; }
.filter-card input, .filter-card select { width: 100%; min-height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 12px; outline: none; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: 14px; }
.filter-card input:focus, .filter-card select:focus { border-color: var(--blue); }
.device-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.device-card { display: flex; min-width: 0; overflow: hidden; border-radius: 23px; background: var(--surface); transition: transform 220ms ease, box-shadow 220ms ease; }
.device-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.device-image { display: grid; width: 126px; min-height: 155px; flex: none; place-items: center; overflow: hidden; color: var(--blue); background: var(--blue-soft); }
.device-image img { width: 100%; height: 100%; object-fit: cover; }
.device-image .icon { width: 40px; height: 40px; }
.device-card-body { display: flex; min-width: 0; flex: 1; flex-direction: column; padding: 19px 18px; }
.device-category { color: var(--muted); font-size: 11px; font-weight: 650; }
.device-card h2 { overflow: hidden; margin: 10px 0 0; font-size: 18px; line-height: 1.25; letter-spacing: -.025em; text-overflow: ellipsis; white-space: nowrap; }
.device-card p { overflow: hidden; margin: 5px 0 0; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.device-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 16px; }
.warranty-badge { display: inline-flex; max-width: 100%; min-height: 27px; align-items: center; padding: 4px 9px; border-radius: 9px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.warranty-none { color: var(--muted); background: var(--background); }
.warranty-normal { color: #16845d; background: rgb(34 181 119 / 13%); }
.warranty-soon { color: #a76500; background: rgb(245 173 30 / 17%); }
.warranty-expired { color: #c93535; background: rgb(220 53 53 / 12%); }
.recent-list { margin: 8px 0 0; padding: 0; list-style: none; }
.recent-list li + li { border-top: 1px solid var(--line); }
.recent-list a { display: flex; min-height: 48px; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.recent-list time { color: var(--muted); font-size: 12px; }

.detail-page { max-width: 720px; margin: -18px auto 0; }
.detail-topbar { position: sticky; z-index: 11; top: calc(8px + env(safe-area-inset-top)); display: flex; min-height: 56px; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; padding: 4px 7px 4px 12px; border: 1px solid var(--line); border-radius: 19px; background: var(--glass); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px); }
.detail-back, .detail-more { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; border: 0; border-radius: 13px; color: var(--blue); background: transparent; font: inherit; font-size: 14px; font-weight: 650; }
.detail-back { padding: 0 11px; }
.detail-more { padding: 0 11px; cursor: pointer; }
.detail-back:hover, .detail-more:hover { background: var(--surface); }
.detail-back-chevron { width: 9px; height: 9px; transform: rotate(45deg); border-bottom: 2px solid currentColor; border-left: 2px solid currentColor; }
.device-hero-card { overflow: hidden; border-radius: 23px; background: var(--surface); box-shadow: var(--shadow); }
.device-hero-media { display: flex; height: 156px; align-items: center; justify-content: center; overflow: hidden; background: var(--surface-soft); }
.device-hero-media img { display: block; width: 100%; height: 100%; object-fit: contain; }
.device-hero-media .device-placeholder { width: 174px; height: 112px; }
.device-hero-content { display: flex; flex-direction: column; align-items: flex-start; padding: 21px 22px 22px; }
.device-hero-title { min-width: 0; width: 100%; }
.device-hero-title h1 { margin: 9px 0 5px; overflow-wrap: anywhere; font-size: clamp(24px, 6vw, 28px); font-weight: 720; line-height: 1.22; letter-spacing: -.035em; }
.device-hero-title p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.device-status-pill { display: inline-flex; min-height: 27px; align-items: center; gap: 7px; margin-top: 16px; padding: 4px 10px; border-radius: 100px; color: var(--ink); background: var(--background); font-size: 12px; font-weight: 650; }
.device-status-pill > span { width: 6px; height: 6px; border-radius: 50%; background: var(--blue); }
.detail-edit { width: 100%; margin-top: 21px; }
.detail-overview { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.overview-tile { display: flex; min-width: 0; min-height: 122px; flex-direction: column; align-items: flex-start; padding: 17px 18px; border-radius: 22px; background: var(--surface); }
.overview-tile > span { color: var(--muted); font-size: 12px; font-weight: 600; }
.overview-tile > strong { margin-top: 16px; overflow-wrap: anywhere; font-size: 19px; font-weight: 690; line-height: 1.25; letter-spacing: -.025em; }
.overview-tile > small { margin-top: 4px; color: var(--muted); font-size: 12px; line-height: 1.4; }
.overview-warranty-soon > strong { color: #a76500; }
.overview-warranty-expired > strong { color: #c93535; }
.detail-section { margin-top: 29px; }
.detail-section > h2, .detail-section-heading h2 { margin: 0 0 12px; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: -.025em; }
.detail-list { margin: 0; padding: 0 19px; border-radius: 22px; background: var(--surface); }
.detail-row { display: flex; min-height: 55px; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-row:last-child { border-bottom: 0; }
.detail-row dt { flex: none; color: var(--muted); font-size: 13px; }
.detail-row dd { max-width: 68%; margin: 0; overflow-wrap: anywhere; font-size: 15px; line-height: 1.5; text-align: right; white-space: pre-wrap; }
.detail-row-long { align-items: flex-start; flex-direction: column; gap: 6px; padding: 16px 0; }
.detail-row-long dd { max-width: 100%; text-align: left; }
.serial-toggle { min-height: 44px; margin-left: 9px; padding: 0 3px; }
.missing-details { margin-top: 14px; padding: 0 19px; border-radius: 20px; background: var(--surface); }
.missing-details summary { display: flex; min-height: 52px; align-items: center; justify-content: space-between; gap: 12px; color: var(--blue); cursor: pointer; font-size: 14px; font-weight: 650; list-style: none; }
.missing-details summary::-webkit-details-marker { display: none; }
.missing-details summary span { color: var(--muted); font-size: 12px; }
.missing-details > div { padding-bottom: 8px; }
.missing-details > div > div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.detail-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.detail-section-heading > span { color: var(--muted); font-size: 12px; }
.maintenance-add { width: 100%; margin-bottom: 15px; }
.maintenance-empty { display: flex; min-height: 215px; flex-direction: column; align-items: center; justify-content: center; padding: 25px; border-radius: 22px; background: var(--surface); text-align: center; }
.maintenance-empty .icon { width: 29px; height: 29px; margin-bottom: 14px; color: var(--blue); }
.maintenance-empty strong { font-size: 16px; }
.maintenance-empty p { margin: 7px 0 16px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.device-menu-content { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
.device-menu-content .sheet-header { padding-bottom: 12px; }
.menu-danger { display: flex; width: calc(100% - 52px); min-height: 54px; align-items: center; margin: 0 26px; padding: 0 16px; border: 0; border-radius: 13px; color: #c93535; background: var(--background); cursor: pointer; font: inherit; font-size: 15px; font-weight: 650; text-align: left; }
.device-menu-content > p { margin: 13px 26px 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.timeline { position: relative; margin: 5px 0 0 10px; padding-left: 23px; border-left: 1px solid var(--line); }
.timeline-item { position: relative; padding: 0 0 14px; }
.timeline-dot { position: absolute; top: 24px; left: -30px; width: 13px; height: 13px; border: 3px solid var(--blue); border-radius: 50%; background: var(--surface); }
.timeline-card { padding: 20px 22px; border-radius: 20px; background: var(--surface); }
.timeline-top { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.timeline-top strong { color: var(--ink); font-size: 14px; }
.timeline-card h3 { margin: 11px 0 0; font-size: 17px; }
.timeline-card p { margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; white-space: pre-wrap; }
.timeline-device { display: inline-flex; min-height: 30px; align-items: center; margin-top: 5px; color: var(--blue); font-size: 13px; }
.inline-actions { display: flex; gap: 18px; margin-top: 12px; }
.inline-actions button { min-height: 38px; padding: 0; border: 0; color: var(--blue); background: none; cursor: pointer; font: inherit; font-size: 13px; font-weight: 650; }
.inline-actions .danger-link { color: #c93535; }

.sheet { position: fixed; inset: auto 0 var(--keyboard-offset); width: min(100%, 640px); max-width: 100%; max-height: min(88dvh, calc(100vh - var(--keyboard-offset) - 12px)); margin: 0 auto; overflow: auto; border: 1px solid var(--line); border-radius: 25px 25px 0 0; color: var(--ink); background: var(--surface); box-shadow: 0 -20px 70px rgb(0 0 0 / 16%); }
.sheet::backdrop { background: rgb(0 0 0 / 42%); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-form { display: flex; max-height: min(88dvh, 900px); flex-direction: column; }
.sheet-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 25px 26px 16px; }
.sheet-header h2, .confirm-content h2 { margin: 8px 0 0; font-size: 27px; letter-spacing: -.04em; }
.close-button { width: 44px; height: 44px; flex: none; border: 0; border-radius: 50%; color: var(--muted); background: var(--background); cursor: pointer; font-size: 25px; }
.form-scroll { min-height: 0; overflow: auto; padding: 0 26px 18px; }
.sheet:has(.sheet-form), .sheet .form-scroll { scrollbar-width: none; -ms-overflow-style: none; }
.sheet:has(.sheet-form)::-webkit-scrollbar, .sheet .form-scroll::-webkit-scrollbar { display: none; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-field { display: flex; min-width: 0; flex-direction: column; gap: 7px; font-size: 13px; font-weight: 650; }
.form-field.full, .check-field.full { grid-column: 1 / -1; }
.form-field input, .form-field select, .form-field textarea { width: 100%; min-height: 46px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: 15px; font-weight: 400; }
.form-field textarea { resize: vertical; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { border-color: var(--blue); }
.form-field input[type="file"] { padding: 8px; font-size: 13px; }
.form-field small { color: var(--muted); font-size: 11px; font-weight: 400; }
.check-field { display: flex; min-height: 44px; align-items: center; gap: 10px; font-size: 13px; }
.check-field input { width: 18px; height: 18px; accent-color: var(--blue); }
.form-error, .confirm-error { margin: 0 26px 10px; color: #c93535; font-size: 13px; line-height: 1.5; }
.form-error[hidden] { display: none; }
.sheet-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 26px calc(17px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--surface); }
.confirm-content { padding: 28px 26px calc(20px + env(safe-area-inset-bottom)); }
.confirm-content > p { margin: 12px 0 0; color: var(--muted); font-size: 15px; line-height: 1.6; }
.confirm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 26px; }
.confirm-error { margin: 12px 0 0; }
.toast { position: fixed; z-index: 30; left: 50%; bottom: calc(98px + env(safe-area-inset-bottom)); width: max-content; max-width: min(90vw, 400px); padding: 12px 18px; transform: translateX(-50%); border-radius: 100px; color: #fff; background: #252528; box-shadow: 0 10px 25px rgb(0 0 0 / 16%); font-size: 13px; font-weight: 650; text-align: center; }
.storage-warning { margin-bottom: 20px; padding: 14px 17px; border-radius: 14px; color: #8a5100; background: rgb(245 173 30 / 17%); font-size: 13px; line-height: 1.5; }
.pwa-banner { display: flex; min-height: 44px; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; padding: 10px 15px; border-radius: 14px; color: var(--ink); background: var(--surface); font-size: 13px; line-height: 1.45; }
.pwa-banner button { min-height: 44px; flex: none; padding: 0 7px; border: 0; color: var(--blue); background: transparent; cursor: pointer; font: inherit; font-weight: 700; }
.backup-card { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }
.backup-card > p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }
.backup-summary, .backup-report { display: flex; width: 100%; flex-direction: column; gap: 5px; padding: 14px 15px; border-radius: 13px; background: var(--background); font-size: 13px; line-height: 1.5; }
.backup-summary strong, .backup-report strong { color: var(--ink); font-size: 14px; }
.backup-summary span, .backup-report span { color: var(--muted); }
.backup-file-label { display: flex; width: 100%; flex-direction: column; gap: 9px; font-size: 14px; font-weight: 650; }
.backup-file-label input { width: 100%; min-height: 48px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); background: var(--surface-soft); font: inherit; font-size: 13px; font-weight: 400; }
.backup-success { color: #16845d !important; font-weight: 650; }
.backup-error { color: #c93535 !important; }
.backup-report { border: 1px solid rgb(34 181 119 / 35%); }

@media (max-width: 680px) {
  .page-heading-row { align-items: stretch; flex-direction: column; gap: 18px; }
  .page-heading-row .primary-button { align-self: flex-start; }
  .device-grid { grid-template-columns: 1fr; }
  .device-image { width: 116px; min-height: 142px; }
  .detail-page { margin-top: -9px; }
  .device-hero-media { height: 144px; }
  .device-hero-content { padding: 19px 20px 20px; }
  .overview-tile { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .filter-card { flex-direction: column; }
  .category-field { width: 100%; }
}

@media (prefers-reduced-transparency: reduce) {
  .detail-topbar { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
