:root {
  color-scheme: light;
  --bg: #f6f5f1;
  --card: #ffffff;
  --ink: #171916;
  --muted: #747b72;
  --soft: #f1f0ea;
  --line: #e8e5dd;
  --green: #31b56d;
  --green-deep: #18804d;
  --green-soft: #e9f8ef;
  --amber-soft: #fff5dd;
  --red-soft: #fdece9;
  --shadow: 0 10px 28px rgba(35, 34, 29, 0.07);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  min-width: 0;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
}

html {
  background-color: var(--bg);
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  border: 0;
  cursor: pointer;
  touch-action: manipulation;
}

.svg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.nav-icon {
  display: block;
  width: 1.08rem;
  height: 1.08rem;
  flex: 0 0 auto;
}

.app-shell {
  min-height: 100dvh;
  width: min(1160px, 100%);
  margin: 0 auto;
  padding:
    max(12px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    calc(128px + env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
}

.desktop-nav {
  display: none;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.topbar,
.page-head,
.subpage-head {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 14px;
}

.topbar,
.app-header {
  position: sticky;
  top: 0;
  z-index: 4;
  align-items: center;
  justify-content: space-between;
  margin: 0 -14px;
  padding: 8px 14px 10px;
  background: rgba(246, 245, 241, 0.92);
  backdrop-filter: blur(16px);
}

.brand-lockup,
.app-header-main,
.subpage-head > div {
  flex: 1;
  min-width: 0;
  text-align: left;
}

.app-header-main {
  padding-right: 8px;
}

.app-header-main h1,
.app-header-main p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: 1.32rem;
  line-height: 1.08;
  letter-spacing: 0;
}

h2 {
  font-size: 1.04rem;
  letter-spacing: 0;
}

h3 {
  font-size: 0.96rem;
}

.brand-lockup p,
.page-head p,
.subpage-head p,
.muted-copy {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.page-head {
  padding: 8px 2px 14px;
}

.page-head.app-header {
  padding: 8px 14px 10px;
}

.subpage-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 -14px 14px;
  padding: 10px 14px 12px;
  background: rgba(246, 245, 241, 0.94);
  backdrop-filter: blur(16px);
  text-align: left;
}

.subpage-head h1,
.subpage-head p {
  text-align: left;
}

.icon-button,
.back-button,
.panel-close {
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
}

.icon-button,
.back-button {
  width: 36px;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--line);
  box-shadow: 0 4px 14px rgba(34, 32, 28, 0.04);
}

@media (pointer: coarse) {
  .icon-button,
  .back-button,
  .panel-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
  }
}

.navigation-menu-button {
  width: 44px;
  min-width: 44px;
  height: 44px;
  flex: 0 0 auto;
  color: #4f5750;
  font-size: 1.18rem;
  line-height: 1;
}

.back-button {
  flex: 0 0 auto;
  font-size: 1.55rem;
}

.overview-card,
.content-block,
.settings-card,
.detail-card,
.editor-card,
.sell-card {
  border: 1px solid rgba(232, 229, 221, 0.9);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.overview-card {
  overflow: hidden;
  margin-top: 10px;
  padding: 18px 17px 15px;
  border-color: rgba(221, 232, 216, 0.92);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(250, 249, 244, 0.96) 54%, rgba(235, 249, 241, 0.9) 100%);
  box-shadow: 0 16px 36px rgba(35, 34, 29, 0.08);
}

.overview-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(112px, 37%);
  align-items: stretch;
  gap: 13px;
}

.overview-head > div:first-child {
  min-width: 0;
}

.metric-label,
.overview-meta span,
.daily-badge span,
.stat-card span,
.metric span {
  display: block;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 680;
}

.overview-head strong {
  display: block;
  margin-top: 6px;
  font-size: clamp(1.95rem, 9vw, 2.8rem);
  line-height: 0.96;
  overflow-wrap: anywhere;
}

.daily-badge {
  min-width: 0;
  padding: 12px 12px 11px;
  border: 1px solid rgba(49, 181, 109, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(145deg, rgba(233, 248, 239, 0.9), rgba(255, 255, 255, 0.58));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  text-align: right;
}

.daily-badge strong {
  display: block;
  margin-top: 5px;
  color: var(--green-deep);
  font-size: clamp(1.45rem, 5.8vw, 1.9rem);
  line-height: 1;
  white-space: nowrap;
}

.overview-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgba(215, 224, 211, 0.74);
}

.overview-meta strong {
  display: inline;
  margin-top: 0;
  color: var(--ink);
  font-size: 0.98rem;
  font-weight: 840;
}

#valuationCard {
  opacity: 0.7;
}

#valuationCard strong {
  font-size: 0.88rem;
  font-weight: 760;
}

.status-strip {
  display: flex;
  gap: 8px;
  margin-top: 13px;
  overflow-x: auto;
  scrollbar-width: none;
}

.status-strip::-webkit-scrollbar {
  display: none;
}

.status-strip span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 720;
}

.status-strip strong {
  color: var(--ink);
}

.collection-toolbar-host {
  min-width: 0;
}

.collection-toolbar {
  display: grid;
  gap: 10px;
  margin: 12px 0 4px;
  padding: 12px;
  border: 1px solid rgba(232, 229, 221, 0.9);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 7px 20px rgba(35, 34, 29, 0.035);
}

.collection-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 7px;
  min-width: 0;
  min-height: 46px;
  padding: 0 0 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.collection-search:focus-within {
  border-color: rgba(49, 181, 109, 0.42);
  box-shadow: 0 0 0 3px rgba(49, 181, 109, 0.1);
}

.collection-search input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.collection-search input::-webkit-search-cancel-button {
  display: none;
}

.collection-search button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--muted);
  font-size: 1rem;
  font-weight: 820;
}

.collection-search button[hidden] {
  display: none;
}

.collection-filter-stack,
.collection-filter-group {
  display: grid;
  min-width: 0;
}

.collection-filter-stack {
  gap: 8px;
}

.collection-filter-group {
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 7px;
}

.collection-filter-group > span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 820;
}

.collection-filter-rail {
  display: flex;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  white-space: nowrap;
}

.collection-filter-rail::-webkit-scrollbar {
  display: none;
}

.collection-filter-rail button {
  flex: 0 0 auto;
  max-width: 132px;
  min-height: 44px;
  overflow: hidden;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(247, 247, 243, 0.9);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.collection-filter-rail button.is-active {
  border-color: rgba(49, 181, 109, 0.22);
  background: var(--green-soft);
  color: var(--green-deep);
}

.collection-control-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.collection-sort-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-width: 0;
  height: 44px;
  gap: 7px;
  padding: 0 10px 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 760;
}

.collection-sort-control select {
  width: 100%;
  min-width: 0;
  height: 42px;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 780;
}

.collection-direction-button,
.collection-view-toggle button {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-weight: 820;
}

.collection-direction-button {
  border-radius: 12px;
  font-size: 1rem;
}

.collection-direction-button small {
  display: none;
}

.collection-view-toggle {
  display: grid;
  grid-template-columns: repeat(2, 44px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.collection-view-toggle button {
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 1.05rem;
}

.collection-view-toggle button + button {
  border-left: 1px solid var(--line);
}

.collection-view-toggle button.is-active {
  background: var(--green-soft);
  color: var(--green-deep);
}

.collection-filter-rail button:focus-visible,
.collection-search button:focus-visible,
.collection-sort-control:has(select:focus-visible),
.collection-direction-button:focus-visible,
.collection-view-toggle button:focus-visible {
  outline: 3px solid rgba(49, 181, 109, 0.22);
  outline-offset: 2px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 2px 10px;
}

.section-heading span {
  color: var(--muted);
  font-size: 0.86rem;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 20px;
}

#itemGrid {
  touch-action: pan-y pinch-zoom;
}

.item-grid.is-list {
  grid-template-columns: minmax(0, 1fr);
}

.item-grid.is-list .item-card > button {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: stretch;
}

.item-grid.is-list .item-photo {
  width: 96px;
  height: 104px;
  margin: 8px;
  aspect-ratio: auto;
}

.item-grid.is-list .item-body {
  align-self: center;
  padding: 11px 12px 11px 4px;
}

.item-grid.is-list .item-title {
  min-height: 0;
  max-height: 44px;
  font-size: 0.94rem;
}

.empty-state {
  grid-column: 1 / -1;
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.62);
  text-align: center;
}

.empty-state p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.item-card,
.warranty-item {
  overflow: hidden;
  border: 1px solid rgba(232, 229, 221, 0.86);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 7px 18px rgba(35, 34, 29, 0.05);
}

.item-card button {
  display: block;
  width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.item-photo,
.detail-photo,
.thumb {
  position: relative;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.84) 0 12%, transparent 13%),
    linear-gradient(145deg, var(--photo-a), var(--photo-b));
  color: rgba(24, 26, 22, 0.72);
  font-weight: 850;
}

.item-photo {
  aspect-ratio: 4 / 3;
  margin: 8px 8px 0;
  border-radius: 14px;
  font-size: 1.55rem;
}

.thumb {
  width: 62px;
  height: 62px;
  flex: 0 0 auto;
  border-radius: 16px;
  font-size: 1rem;
}

.warranty-alert {
  position: absolute;
  top: 7px;
  left: 7px;
  max-width: calc(100% - 14px);
  overflow: hidden;
  padding: 4px 7px;
  border-radius: 999px;
  background: rgba(255, 246, 219, 0.94);
  color: #7a5510;
  font-size: 0.66rem;
  font-weight: 820;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warranty-alert.expired {
  background: rgba(253, 236, 233, 0.95);
  color: #9d4038;
}

.item-body {
  padding: 9px 10px 10px;
}

.item-title {
  display: -webkit-box;
  min-height: 38px;
  max-height: 38px;
  overflow: hidden;
  font-size: 0.88rem;
  font-weight: 820;
  line-height: 1.28;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 7px;
}

.pill {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
}

.pill.green {
  background: var(--green-soft);
  color: var(--green-deep);
}

.pill.amber {
  background: var(--amber-soft);
  color: #8f6b16;
}

.pill.red {
  background: var(--red-soft);
  color: #aa463d;
}

.price {
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 810;
}

.cost-list {
  display: grid;
  gap: 3px;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.73rem;
}

.cost-list span {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.cost-list strong {
  color: var(--ink);
}

.daily-line strong {
  color: var(--green-deep);
  font-size: 0.9rem;
}

.valuation-line {
  color: #8c9289;
  font-size: 0.7rem;
  opacity: 0.72;
}

.bottom-nav {
  position: fixed;
  right: max(10px, env(safe-area-inset-right));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(10px, env(safe-area-inset-left));
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr 1fr 58px 1fr 1fr;
  align-items: center;
  width: auto;
  max-width: 430px;
  min-height: 64px;
  margin: 0 auto;
  padding: 8px 10px;
  border: 1px solid rgba(232, 229, 221, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 34px rgba(28, 31, 27, 0.16);
  backdrop-filter: blur(18px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.bottom-nav button {
  display: grid;
  place-items: center;
  gap: 2px;
  min-height: 44px;
  background: transparent;
  color: #747b72;
  font-size: 0.68rem;
  font-weight: 800;
}

.bottom-nav button span {
  font-size: 1.08rem;
  line-height: 1;
}

.bottom-nav button.is-active {
  color: var(--green-deep);
}

.bottom-nav .fab {
  width: 51px;
  height: 51px;
  min-height: 51px;
  margin: -20px auto 0;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-size: 1.75rem;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(49, 181, 109, 0.34);
}

.global-navigation-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
}

.global-navigation-layer[hidden] {
  display: none;
}

.global-navigation-scrim {
  position: absolute;
  inset: 0;
  background: rgba(28, 31, 27, 0.36);
  opacity: 0;
  transition: opacity 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.navigation-drawer {
  position: relative;
  width: min(86vw, 340px);
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  padding:
    max(18px, env(safe-area-inset-top))
    14px
    max(20px, env(safe-area-inset-bottom));
  border-right: 1px solid rgba(225, 225, 217, 0.92);
  border-radius: 0 24px 24px 0;
  background: #fbfaf7;
  box-shadow: 18px 0 44px rgba(28, 31, 27, 0.18);
  outline: 0;
  transform: translateX(-104%);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.global-navigation-layer.is-open .global-navigation-scrim {
  opacity: 1;
}

.global-navigation-layer.is-open .navigation-drawer {
  transform: translateX(0);
}

body.navigation-drawer-open {
  overflow: hidden;
}

.navigation-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 0 2px 12px;
}

.navigation-drawer-head span {
  color: var(--green-deep);
  font-size: 0.72rem;
  font-weight: 850;
}

.navigation-drawer-head h2 {
  margin-top: 3px;
  font-size: 1.28rem;
}

.navigation-drawer-close {
  display: grid;
  width: 44px;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--ink);
  font-size: 1.35rem;
}

.navigation-drawer-section {
  margin-top: 12px;
  padding: 8px 12px;
  border: 1px solid rgba(232, 229, 221, 0.92);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(34, 32, 28, 0.04);
}

.navigation-drawer-section h3 {
  padding: 3px 2px 6px;
  color: #788078;
  font-size: 0.7rem;
  font-weight: 850;
}

.navigation-drawer-row,
.navigation-drawer-static {
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.navigation-drawer-section > :last-child {
  border-bottom: 0;
}

.navigation-drawer-row > span,
.navigation-drawer-static > span {
  min-width: 0;
}

.navigation-drawer-row strong,
.navigation-drawer-static strong,
.navigation-drawer-row small,
.navigation-drawer-static small {
  display: block;
}

.navigation-drawer-row strong,
.navigation-drawer-static strong {
  font-size: 0.9rem;
}

.navigation-drawer-row small,
.navigation-drawer-static small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.navigation-drawer-row b {
  flex: 0 0 auto;
  color: var(--green-deep);
  font-size: 1.08rem;
}

.navigation-drawer-row:focus-visible,
.navigation-drawer-close:focus-visible,
.navigation-menu-button:focus-visible {
  outline: 3px solid rgba(49, 181, 109, 0.34);
  outline-offset: 2px;
}

.app-update-prompt {
  position: fixed;
  right: 14px;
  bottom: calc(max(10px, env(safe-area-inset-bottom)) + 78px);
  left: 14px;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  width: min(430px, calc(100% - 28px));
  min-height: 62px;
  margin: 0 auto;
  padding: 10px 10px 10px 14px;
  border: 1px solid rgba(49, 181, 109, 0.2);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 16px 38px rgba(28, 31, 27, 0.18);
}

.app-update-prompt[hidden] {
  display: none;
}

.app-update-prompt > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.app-update-prompt strong,
.app-update-prompt span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-update-prompt strong {
  font-size: 0.88rem;
}

.app-update-prompt span {
  color: var(--muted);
  font-size: 0.7rem;
}

.app-update-prompt button {
  min-height: 40px;
  padding: 0 11px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.app-update-prompt .primary-button {
  background: var(--green);
  color: white;
}

#openAddButton.is-action-unavailable,
.desktop-add-button.is-action-unavailable {
  visibility: hidden;
  pointer-events: none;
}


.after-sales-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 14px 0 4px;
  padding: 4px;
  border: 1px solid rgba(49, 181, 109, 0.12);
  border-radius: 16px;
  background: rgba(232, 237, 232, 0.72);
}

.after-sales-switch button {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 820;
}

.after-sales-switch button.is-active {
  background: var(--card);
  color: var(--green-deep);
  box-shadow: 0 5px 14px rgba(31, 47, 36, 0.08);
}

[data-after-sales-pane][hidden] {
  display: none !important;
}

.document-library-summary {
  display: grid;
  gap: 10px;
  overflow: hidden;
  border-color: rgba(208, 232, 216, 0.9);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(238, 249, 242, 0.9));
}

.document-library-summary > div {
  display: grid;
  gap: 3px;
}

.document-library-summary span,
.document-library-summary small,
.document-library-summary p {
  color: var(--muted);
}

.document-library-summary span,
.document-library-summary small {
  font-size: 0.72rem;
  font-weight: 760;
}

.document-library-summary strong {
  color: var(--green-deep);
  font-size: 1.28rem;
  line-height: 1.15;
}

.document-library-summary p {
  padding-top: 10px;
  border-top: 1px solid rgba(49, 181, 109, 0.13);
  font-size: 0.74rem;
  line-height: 1.5;
}

.document-library-browser {
  margin-top: 15px;
}

.document-library-list {
  display: grid;
  gap: 10px;
}

.document-library-list.is-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.document-library-list.is-grid .document-library-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: start;
  min-height: 0;
}

.document-library-list.is-grid .document-library-item > .thumb {
  grid-column: 1 / -1;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}

.document-library-list.is-grid .document-library-copy {
  grid-column: 1 / -1;
}

.document-library-list.is-grid .document-library-item > em {
  grid-column: 1;
  justify-self: start;
}

.document-library-list.is-grid .document-library-item > span:last-child {
  display: none;
}

.document-library-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto 12px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-width: 0;
  min-height: 78px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(28, 31, 27, 0.04);
}

.document-library-item:active {
  transform: translateY(1px);
}

.document-library-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.document-library-copy strong,
.document-library-copy small,
.document-library-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-library-copy strong {
  font-size: 0.9rem;
}

.document-library-copy small,
.document-library-copy > span {
  color: var(--muted);
  font-size: 0.7rem;
}

.document-library-item > em {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 820;
  white-space: nowrap;
}
.warranty-summary-card {
  overflow: hidden;
  padding: 15px 16px;
  border-color: rgba(208, 232, 216, 0.9);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(238, 249, 242, 0.9) 100%);
}

.warranty-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.warranty-summary-head > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.warranty-summary-head span,
.warranty-summary-head small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

.warranty-summary-head strong {
  overflow: hidden;
  font-size: 0.98rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warranty-summary-head small {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.warranty-summary-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid rgba(49, 181, 109, 0.13);
}

.warranty-summary-metrics > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 0 10px;
  border-left: 1px solid rgba(49, 181, 109, 0.12);
}

.warranty-summary-metrics > div:first-child {
  padding-left: 0;
  border-left: 0;
}

.warranty-summary-metrics strong {
  font-size: 1.24rem;
  line-height: 1;
}

.warranty-summary-metrics span {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warranty-summary-metrics .valid strong {
  color: var(--green-deep);
}

.warranty-summary-metrics .expiring strong {
  color: #9b7014;
}

.warranty-summary-metrics .expired strong {
  color: #a8463f;
}

.warranty-browser,
.wishlist-browser {
  margin-top: 15px;
}

.warranty-list-heading,
.wishlist-list-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 2px 10px;
}

.warranty-list-heading > div,
.wishlist-list-heading > div {
  min-width: 0;
}

.warranty-list-heading p,
.wishlist-list-heading p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.warranty-list-heading > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 780;
}

.warranty-filter-rail,
.wishlist-filter-rail {
  display: flex;
  gap: 7px;
  margin: 0 -2px 10px;
  padding: 1px 2px 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.warranty-filter-rail::-webkit-scrollbar,
.wishlist-filter-rail::-webkit-scrollbar {
  display: none;
}

.warranty-filter-rail button,
.wishlist-filter-rail button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: #626960;
  font-size: 0.76rem;
  font-weight: 790;
}

.warranty-filter-rail button.is-active,
.wishlist-filter-rail button.is-active {
  border-color: rgba(49, 181, 109, 0.2);
  background: var(--green-soft);
  color: var(--green-deep);
}

.aftercare-shell {
  margin-bottom: 8px;
  box-shadow: none;
}

.aftercare-shell .section-heading {
  margin: 0 0 9px;
}

.aftercare-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.aftercare-links button {
  display: grid;
  min-width: 0;
  min-height: 54px;
  align-content: center;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 15px;
  background: var(--soft);
  text-align: left;
}

.aftercare-links span {
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 810;
}

.aftercare-links strong {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 730;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-page {
  padding-bottom: 8px;
}

.wishlist-summary-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-color: rgba(211, 229, 216, 0.9);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(241, 250, 245, 0.9) 100%);
}

.wishlist-summary-icon,
.wishlist-empty-visual {
  display: grid;
  place-items: center;
  border-radius: 17px;
  background: var(--green-soft);
  color: var(--green-deep);
}

.wishlist-summary-icon {
  width: 50px;
  height: 50px;
}

.wishlist-summary-icon .nav-icon {
  width: 22px;
  height: 22px;
}

.wishlist-summary-card > div:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.wishlist-summary-card span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.wishlist-summary-card strong {
  overflow: hidden;
  font-size: 1.02rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-summary-card p {
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 780;
  line-height: 1.4;
}

.wishlist-list {
  display: grid;
  gap: 9px;
}

.wishlist-list.is-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wishlist-list.is-grid .wishlist-item-card > button {
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  gap: 9px;
  height: 100%;
}

.wishlist-list.is-grid .wishlist-item-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
}

.wishlist-list.is-grid .wishlist-item-main {
  align-self: start;
}

.wishlist-list.is-grid .wishlist-item-chevron {
  display: none;
}

.wishlist-list.is-grid .wishlist-item-title-row {
  display: grid;
  gap: 6px;
}

.wishlist-list.is-grid .wishlist-status {
  justify-self: start;
}

.wishlist-item-card {
  overflow: hidden;
  border: 1px solid rgba(232, 229, 221, 0.94);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 7px 20px rgba(35, 34, 29, 0.045);
}

.wishlist-item-card > button {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 18px;
  width: 100%;
  min-height: 102px;
  align-items: center;
  gap: 11px;
  padding: 12px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.wishlist-item-card > button:focus-visible {
  outline: 3px solid rgba(49, 181, 109, 0.24);
  outline-offset: -3px;
}

.wishlist-item-main {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.wishlist-item-title-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.wishlist-item-title-row h3 {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  font-size: 0.96rem;
  line-height: 1.34;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wishlist-status {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.68rem;
  font-weight: 820;
  line-height: 1.2;
}

.wishlist-status.abandoned {
  background: var(--soft);
  color: var(--muted);
}

.wishlist-item-price {
  color: var(--green-deep);
  font-size: 0.93rem;
  line-height: 1.25;
}

.wishlist-item-photo,
.wishlist-detail-photo,
.wishlist-convert-photo {
  display: grid;
  overflow: hidden;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(145deg, var(--photo-a), var(--photo-b));
  color: #3c4a43;
  font-weight: 850;
}

.wishlist-item-photo {
  width: 64px;
  height: 70px;
  border-radius: 16px;
  font-size: 0.86rem;
}

.wishlist-item-photo > img,
.wishlist-detail-photo > img,
.wishlist-convert-photo > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wishlist-item-meta {
  display: flex;
  min-width: 0;
  flex-wrap: wrap;
  gap: 3px 6px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.wishlist-item-model {
  overflow: hidden;
  color: #61685f;
  font-size: 0.74rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-item-chevron {
  color: #a0a59e;
  font-size: 1.35rem;
  line-height: 1;
}

.wishlist-list-footer {
  display: flex;
  justify-content: center;
  padding: 13px 0 2px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 740;
}

.wishlist-empty-state {
  display: grid;
  justify-items: center;
  gap: 9px;
  min-height: 252px;
  padding: 28px 18px 24px;
  border: 1px solid rgba(232, 229, 221, 0.9);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  text-align: center;
}

.wishlist-empty-visual {
  width: 64px;
  height: 64px;
  margin-bottom: 3px;
  border-radius: 21px;
}

.wishlist-empty-visual .nav-icon {
  width: 26px;
  height: 26px;
}

.wishlist-empty-state h2 {
  font-size: 1.06rem;
}

.wishlist-empty-state p {
  max-width: 280px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.wishlist-empty-state .primary-button {
  min-height: 42px;
  margin-top: 3px;
  padding: 0 17px;
  border-radius: 999px;
}

.wishlist-convert-preview {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.wishlist-form {
  width: min(720px, 100%);
  margin: 12px auto 0;
  padding: 15px;
}

.wishlist-form .main-image-editor {
  margin-top: 14px;
}

.wishlist-more-fields {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: rgba(250, 250, 247, 0.92);
}

.wishlist-more-fields summary {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 820;
  list-style: none;
}

.wishlist-more-fields summary::-webkit-details-marker {
  display: none;
}

.wishlist-more-fields summary::after {
  content: "›";
  color: var(--muted);
  font-size: 1.15rem;
  transform: rotate(90deg);
  transition: transform 180ms ease;
}

.wishlist-more-fields[open] summary::after {
  transform: rotate(-90deg);
}

.wishlist-more-fields summary span {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 650;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-more-fields .wishlist-form-grid {
  padding: 0 12px 12px;
}

.wishlist-name-field,
.wishlist-notes-field {
  grid-column: 1 / -1;
}

.wishlist-editor-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
  padding-bottom: max(2px, env(safe-area-inset-bottom));
}

.wishlist-editor-actions .secondary-button,
.wishlist-editor-actions .primary-button {
  min-height: 50px;
  border-radius: 16px;
  font-weight: 830;
}

.wishlist-editor-actions .secondary-button {
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
}

.wishlist-delete-button {
  width: 100%;
  min-height: 46px;
  margin-top: 9px;
  border: 1px solid #f0c7c1;
  border-radius: 15px;
  background: var(--red-soft);
  color: #b23b30;
  font-size: 0.8rem;
  font-weight: 820;
}

.wishlist-detail-shell {
  display: grid;
  gap: 12px;
  width: min(680px, 100%);
  margin: 0 auto;
  padding-bottom: 12px;
}

.wishlist-detail-identity {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  padding: 16px;
}

.wishlist-detail-photo {
  width: 92px;
  aspect-ratio: 1;
  border-radius: 22px;
  font-size: 1.25rem;
}

.wishlist-detail-identity > div:last-child {
  display: grid;
  min-width: 0;
  justify-items: start;
  gap: 7px;
}

.wishlist-detail-identity h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.25rem;
  line-height: 1.24;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.wishlist-detail-identity p {
  overflow: hidden;
  max-width: 100%;
  color: var(--muted);
  font-size: 0.78rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-intent-card {
  padding: 17px;
  border-color: rgba(200, 230, 211, 0.9);
  background: linear-gradient(145deg, #ffffff 0%, #effaf3 100%);
}

.wishlist-intent-card > span,
.wishlist-intent-card > small {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
}

.wishlist-intent-card > strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--green-deep);
  font-size: 1.65rem;
  line-height: 1.1;
}

.wishlist-intent-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 15px;
  padding-top: 13px;
  border-top: 1px solid rgba(194, 222, 204, 0.72);
}

.wishlist-intent-meta > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.wishlist-intent-meta span {
  color: var(--muted);
  font-size: 0.66rem;
}

.wishlist-intent-meta strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-notes-card {
  padding: 16px;
}

.wishlist-notes-card p {
  margin-top: 9px;
  color: #4e554e;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.wishlist-notes-card p.is-empty {
  color: var(--muted);
}

.wishlist-detail-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding-top: 2px;
}

.wishlist-detail-actions button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  color: var(--ink);
  font-weight: 820;
}

.wishlist-detail-actions .primary-button {
  border-color: transparent;
  background: var(--green);
  color: white;
}

.wishlist-detail-actions .wishlist-delete-button {
  grid-column: 1 / -1;
  margin-top: 0;
  border-color: #f0c7c1;
  background: var(--red-soft);
  color: #b23b30;
}

.wishlist-convert-form {
  width: min(720px, 100%);
  margin: 12px auto 0;
  padding: 15px;
}

.wishlist-convert-source {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  padding: 11px;
  border: 1px solid rgba(205, 229, 213, 0.92);
  border-radius: 17px;
  background: var(--green-soft);
}

.wishlist-convert-photo {
  width: 64px;
  aspect-ratio: 1;
  border-radius: 15px;
  font-size: 0.82rem;
}

.wishlist-convert-source > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.wishlist-convert-source span,
.wishlist-convert-source small,
.wishlist-convert-note {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.wishlist-convert-source strong {
  overflow: hidden;
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wishlist-convert-note {
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--soft);
}

@media (max-width: 380px) {
  .wishlist-item-card > button {
    grid-template-columns: 58px minmax(0, 1fr) 16px;
    gap: 9px;
    padding: 10px;
  }

  .wishlist-item-photo {
    width: 58px;
    height: 66px;
  }

  .wishlist-detail-identity {
    grid-template-columns: 80px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .wishlist-detail-photo {
    width: 80px;
  }

  .wishlist-intent-meta {
    gap: 6px;
  }
}
.item-photo,
.detail-photo,
.warranty-thumb,
.main-image-preview-media,
.warranty-detail-photo,
.warranty-file-thumb {
  overflow: hidden;
}

.item-photo > img,
.detail-photo > img,
.warranty-thumb > img,
.main-image-preview-media > img,
.warranty-detail-photo > img,
.warranty-file-thumb > img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.main-image-editor {
  border-style: solid;
}

.main-image-editor-head,
.main-image-editor-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.main-image-editor-head > div,
.main-image-editor-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.main-image-editor-head > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.68rem;
  font-weight: 800;
}

.main-image-editor-body {
  justify-content: flex-start;
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
}

.main-image-preview {
  flex: 0 0 auto;
}

.main-image-preview-media {
  position: relative;
  display: grid;
  width: 70px;
  height: 70px;
  place-items: center;
  border-radius: 15px;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.84) 0 12%, transparent 13%),
    linear-gradient(145deg, var(--photo-a), var(--photo-b));
  color: rgba(24, 26, 22, 0.72);
  font-size: 1rem;
  font-weight: 850;
}

.main-image-editor-copy strong,
.main-image-editor-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.main-image-editor-copy strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.main-image-editor-copy span,
.main-image-editor > small {
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.main-image-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 10px 0 8px;
}

.main-image-actions button {
  min-height: 44px;
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 810;
}

.main-image-actions .remove-main-image {
  border: 1px solid #f0c7c1;
  background: var(--red-soft);
  color: #a8463f;
}

.main-image-actions .remove-main-image[hidden] {
  display: none;
}

.main-image-actions button:only-of-type,
.main-image-actions button:first-child:nth-last-child(2):has(+ [hidden]) {
  grid-column: 1 / -1;
}

.warranty-detail-shell {
  display: grid;
  gap: 12px;
}

.warranty-detail-shell .content-block {
  margin-top: 0;
}

.warranty-detail-identity {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: center;
  gap: 13px;
  padding: 13px;
}

.warranty-detail-photo {
  position: relative;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  border-radius: 18px;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.84) 0 12%, transparent 13%),
    linear-gradient(145deg, var(--photo-a), var(--photo-b));
  color: rgba(24, 26, 22, 0.72);
  font-size: 1.25rem;
  font-weight: 850;
}

.warranty-detail-identity > div:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.warranty-detail-identity span,
.warranty-detail-identity p {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.74rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warranty-detail-identity h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 1.18rem;
  line-height: 1.3;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.warranty-detail-summary,
.serial-number-card,
.warranty-documents-card {
  padding: 15px;
}

.warranty-detail-summary .detail-section-head {
  margin-bottom: 12px;
}

.warranty-detail-summary .detail-section-head h2,
.serial-number-card h2,
.warranty-documents-card h2 {
  font-size: 1rem;
}

.warranty-detail-headline {
  display: block;
  color: var(--green-deep);
  font-size: 1.3rem;
  line-height: 1.2;
}

.warranty-detail-summary.is-expiring .warranty-detail-headline {
  color: #956b12;
}

.warranty-detail-summary.is-expired .warranty-detail-headline {
  color: #a8463f;
}

.warranty-detail-summary.is-none .warranty-detail-headline {
  color: var(--muted);
}

.warranty-detail-summary > p {
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 760;
}

.warranty-detail-summary > small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

.serial-number-card .section-heading {
  margin-bottom: 10px;
}

.serial-number-card .section-heading p,
.warranty-documents-head p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.serial-number-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.serial-number-form .form-message,
.serial-number-form input {
  grid-column: 1 / -1;
}

.serial-number-form button {
  min-height: 42px;
  border-radius: 13px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.76rem;
  font-weight: 810;
}

.serial-number-form .clear-serial {
  background: var(--soft);
  color: var(--muted);
}

.serial-number-form > button[type="submit"]:last-child {
  grid-column: 1 / -1;
}

.warranty-documents-head,
.warranty-attachment-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.warranty-documents-head > div,
.warranty-attachment-head > div {
  min-width: 0;
}

.warranty-documents-head > span {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 780;
}

.warranty-storage-note {
  margin-top: 10px;
  padding: 9px 10px;
  border-radius: 12px;
  background: #f7f7f3;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.45;
}

.warranty-attachment-groups {
  display: grid;
  gap: 0;
  margin-top: 6px;
}

.warranty-attachment-group {
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.warranty-attachment-group:first-child {
  border-top: 0;
}

.warranty-attachment-head {
  align-items: center;
}

.warranty-attachment-head h3 {
  font-size: 0.84rem;
}

.warranty-attachment-head span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.warranty-attachment-head > button {
  flex: 0 0 auto;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(49, 181, 109, 0.2);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.72rem;
  font-weight: 810;
}

.warranty-attachment-empty {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.warranty-file-list {
  display: grid;
  gap: 7px;
  margin-top: 9px;
}

.warranty-file-item {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfbf8;
}

.warranty-file-thumb {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.67rem;
  font-weight: 850;
}

.warranty-file-thumb.pdf {
  background: var(--red-soft);
  color: #a8463f;
}

.warranty-file-thumb svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.warranty-file-thumb small {
  margin-top: -3px;
  font-size: 0.54rem;
  line-height: 1;
}

.warranty-file-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.warranty-file-copy strong,
.warranty-file-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warranty-file-copy strong {
  font-size: 0.76rem;
}

.warranty-file-copy span {
  color: var(--muted);
  font-size: 0.66rem;
}

.warranty-file-actions {
  display: grid;
  gap: 4px;
}

.warranty-file-actions button {
  min-width: 46px;
  min-height: 36px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 790;
}

.warranty-file-actions .is-danger {
  background: var(--red-soft);
  color: #a8463f;
}
body.subview-open .bottom-nav {
  display: none;
}

.stat-grid,
.stats-core,
.more-stats-grid,
.warranty-overview,
.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stats-core {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats-core .stat-card {
  min-height: 68px;
  padding: 11px;
}

.stats-core .stat-card strong {
  font-size: clamp(0.96rem, 4.2vw, 1.16rem);
  line-height: 1.12;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.stats-range-control {
  display: grid;
  grid-template-columns: repeat(4, minmax(44px, 1fr));
  flex: 0 1 212px;
  width: min(100%, 212px);
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--soft);
}

.stats-range-control button {
  min-width: 0;
  min-height: 36px;
  padding: 0 7px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 740;
}

.stats-range-control button.is-active {
  background: var(--card);
  color: var(--green-deep);
  font-weight: 840;
}

.stats-range-control button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 3px rgba(49, 181, 109, 0.12);
}

[data-view="stats"] > .content-block {
  margin-top: 10px;
}

.stats-trend-card {
  overflow: hidden;
  padding-top: 10px;
  padding-bottom: 10px;
  background: rgba(255, 255, 255, 0.98);
}

.stats-trend-card .section-heading {
  align-items: center;
  gap: 10px;
  margin-top: 2px;
  margin-bottom: 8px;
}

.stats-trend-plot {
  position: relative;
  display: grid;
  gap: 5px;
}

.stats-trend-value {
  display: block;
  margin: 0 0 5px;
  color: var(--green-deep);
  font-size: 1.42rem;
  font-weight: 880;
  line-height: 1.15;
  letter-spacing: 0;
}

.stats-trend-value span {
  margin-left: 2px;
  font-size: 0.76em;
  font-weight: 820;
}

.stats-trend-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 0;
  overflow: visible;
}

.stats-trend-baseline {
  fill: none;
  stroke: rgba(112, 128, 118, 0.16);
  stroke-linecap: round;
  stroke-width: 1;
}

.stats-trend-line {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.stats-trend-event-jump {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.6;
}

.stats-trend-dot {
  fill: #fff;
  stroke: var(--green);
  stroke-width: 2.6;
}

.stats-trend-dot.is-end {
  fill: var(--green);
  stroke: #fff;
  stroke-width: 2;
}

.stats-trend-event {
  fill: #ee873c;
  stroke: #fff;
  stroke-width: 2;
}

.stats-trend-x-label {
  fill: var(--muted);
  font-family: inherit;
  font-size: 7.5px;
  font-weight: 700;
}

.stats-trend-copy {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.4;
}

.stats-trend-empty {
  display: grid;
  gap: 6px;
  min-height: 86px;
  align-content: center;
  padding: 13px;
  border-radius: 16px;
  background: var(--green-soft);
}

.stats-trend-empty p {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.stats-overview-card {
  padding: 20px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 10px rgba(31, 31, 29, 0.06);
}

.stats-overview-card .section-heading {
  margin: 0 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #f0ebe4;
}

.stats-overview-card .section-heading h2 {
  font-size: 1rem;
  line-height: 1.3;
}

.stats-overview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
}

.asset-distribution,
.daily-observation-list {
  min-width: 0;
}

.asset-distribution {
  display: grid;
  grid-template-columns: 158px minmax(0, 130px);
  justify-content: center;
  align-items: center;
  gap: 10px;
}

.asset-donut-wrap {
  position: relative;
  width: 158px;
  max-width: 100%;
  margin: 0 auto;
  aspect-ratio: 1;
  transform: translateX(-1.25rem);
}

.asset-donut {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
  transform: scale(1.18);
}

.asset-donut-track,
.asset-donut-segment {
  fill: none;
  stroke-width: 14;
}

.asset-donut-track {
  stroke: var(--soft);
}

.asset-donut-segment {
  stroke: var(--segment-color);
  transform: rotate(-90deg);
  transform-origin: 60px 60px;
}

.asset-donut-segment:nth-of-type(2) {
  stroke: #16a34a;
}

.asset-donut-segment:nth-of-type(3) {
  stroke: #9bcbaf;
}

.asset-donut-segment:nth-of-type(4) {
  stroke: #e4c078;
}

.asset-donut-segment:nth-of-type(5) {
  stroke: #d3a48f;
}

.asset-donut-center {
  position: absolute;
  inset: 15%;
  display: grid;
  align-content: center;
  gap: 2px;
  text-align: center;
}

.asset-donut-center strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-donut-center span {
  color: var(--muted);
  font-size: 0.6875rem;
  font-weight: 720;
}

.asset-legend {
  display: grid;
  width: 100%;
  gap: 10px;
  margin-top: 0;
}

.asset-legend-row {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.asset-legend-row i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--legend-color);
}

.asset-legend-row:nth-child(1) i {
  background: #16a34a;
}

.asset-legend-row:nth-child(2) i {
  background: #9bcbaf;
}

.asset-legend-row:nth-child(3) i {
  background: #e4c078;
}

.asset-legend-row:nth-child(4) i {
  background: #d3a48f;
}

.asset-legend-row strong {
  overflow: hidden;
  font-size: 0.8125rem;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-legend-row span {
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 650;
  white-space: nowrap;
}

.daily-observation-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.daily-insight {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "label"
    "photo"
    "value"
    "name";
  min-width: 0;
  align-items: start;
  gap: 2px;
  padding: 0;
  text-align: left;
}

.daily-insight:first-child {
  padding-left: 2rem;
}

.daily-insight:nth-child(2) {
  background: none;
}

.daily-insight-label {
  grid-area: label;
  justify-self: start;
  color: var(--green-deep);
  margin-bottom: 6px;
  font-size: 0.75rem;
  font-weight: 650;
}

.stats-insight-photo {
  grid-area: photo;
  position: relative;
  display: grid;
  width: 48px;
  margin-bottom: 5px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: var(--soft);
  color: #667164;
  font-size: 0.86rem;
  font-weight: 800;
}

.stats-insight-photo:not(.has-main-image) span {
  color: #c4bcb0;
  font-size: 0.62rem;
  font-weight: 600;
}

.stats-insight-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.daily-insight strong {
  grid-area: name;
  display: block;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.daily-insight em {
  grid-area: value;
  align-self: end;
  justify-self: start;
  color: var(--ink);
  font-size: 0.8125rem;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.daily-insight.is-empty strong,
.daily-insight.is-empty em {
  color: var(--muted);
}

.asset-distribution > .empty-state {
  min-height: 210px;
  padding: 18px 8px;
}
.stat-card,
.metric,
.mini-card {
  min-height: 76px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  text-align: left;
}

.stat-card strong,
.metric strong,
.mini-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.02rem;
  overflow-wrap: anywhere;
}

.stat-card.feature,
.metric.feature {
  background: var(--green-soft);
}

.stat-card.feature strong,
.metric.feature strong {
  color: var(--green-deep);
}

.content-block,
.settings-card,
.editor-card,
.sell-card,
.detail-card {
  margin-top: 12px;
  padding: 14px;
  text-align: left;
}

.rank-list,
.insight-list,
.settings-list,
.warranty-list {
  display: grid;
  gap: 10px;
}

.more-stats {
  padding-top: 10px;
}

.more-stats .section-heading {
  margin-top: 2px;
  margin-bottom: 10px;
}

.more-stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  margin-top: 0;
}

.long-term-stat {
  min-width: 0;
  padding: 2px 8px;
  text-align: center;
}

.long-term-stat + .long-term-stat {
  border-left: 1px solid var(--line);
}

.long-term-stat strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
}

.long-term-stat span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.3;
}

.rank-row,
.insight-row,
.warranty-item,
.about-row,
.settings-card button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.rank-row,
.insight-row,
.settings-card button,
.about-row {
  min-height: 46px;
}

.rank-row,
.insight-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.rank-row:last-child,
.insight-row:last-child {
  border-bottom: 0;
}

.bar-track {
  width: 88px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--soft);
}

.bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.settings-card h2 {
  margin-bottom: 8px;
}

.settings-value-row {
  display: flex;
  min-height: 46px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.settings-value-row:last-child {
  border-bottom: 0;
}

.settings-value-row span {
  color: var(--muted);
}

.statistics-defaults-card .form-section-title {
  margin-bottom: 2px;
}

.statistics-defaults-card .form-section-title h2 {
  margin-bottom: 0;
}

.statistics-switch-row + .statistics-switch-row {
  border-top: 1px solid var(--line);
}

.settings-helper {
  margin-top: 8px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.storage-safety-card .form-section-title {
  margin-bottom: 10px;
}

.runtime-load-error .overview-card,
.runtime-load-error .home-status-strip,
.runtime-load-error .collection-toolbar-host {
  display: none;
}

.storage-safety-card .form-section-title h2 {
  margin-bottom: 0;
}

.storage-safety-loading {
  display: grid;
  min-height: 74px;
  align-items: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.storage-safety-summary {
  display: grid;
  gap: 8px;
  padding: 11px;
  border-radius: 14px;
  background: var(--soft);
}

.storage-safety-usage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 5px 12px;
}

.storage-safety-usage > span,
.storage-safety-usage > small {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 720;
}

.storage-safety-usage > strong {
  font-size: 0.86rem;
  text-align: right;
}

.storage-safety-usage > small {
  text-align: right;
}

.storage-safety-meter {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(118, 125, 116, 0.14);
}

.storage-safety-meter i {
  display: block;
  min-width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--green);
}

.storage-safety-risk {
  color: var(--green-deep);
  font-size: 0.75rem;
  font-weight: 760;
  line-height: 1.45;
}

.storage-safety-risk.is-warning {
  color: #8a681b;
}

.storage-safety-risk.is-high {
  color: #a8463f;
}

.storage-safety-risk.is-unknown {
  color: var(--muted);
}

.storage-safety-rows {
  display: grid;
  margin-top: 8px;
}

.storage-safety-rows > div {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  min-height: 40px;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}

.storage-safety-rows > div:last-child {
  border-bottom: 0;
}

.storage-safety-rows span {
  font-size: 0.76rem;
}

.storage-safety-rows strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 0.78rem;
  text-align: right;
}

.storage-safety-notice {
  margin-top: 8px;
  padding: 9px 10px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 730;
  line-height: 1.45;
}

.storage-safety-notice.is-success {
  background: var(--green-soft);
  color: var(--green-deep);
}

.storage-safety-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.settings-card .storage-safety-actions button {
  justify-content: center;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 820;
  text-align: center;
}

.settings-card .storage-safety-actions .storage-protect-button {
  border-color: rgba(47, 188, 112, 0.24);
  background: var(--green-soft);
  color: var(--green-deep);
}

.settings-card .storage-safety-actions button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.settings-card .storage-safety-actions button:only-child {
  grid-column: 1 / -1;
}

@media (max-width: 370px) {
  .storage-safety-actions {
    grid-template-columns: 1fr;
  }
}

.category-add-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-bottom: 12px;
}

.category-add-form input {
  min-height: 40px;
  border-radius: 14px;
}

.category-add-form button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-weight: 840;
}

.category-manage-list {
  display: grid;
  gap: 8px;
}

.category-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.category-row:last-child {
  border-bottom: 0;
}

.category-row strong {
  display: block;
  overflow: hidden;
  font-size: 0.92rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-row span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 720;
}

.category-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.category-actions button {
  width: auto;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.74rem;
  font-weight: 820;
}

.category-actions .danger-mini {
  border-color: rgba(168, 70, 63, 0.22);
  color: #a8463f;
}

.category-lock {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 780;
  white-space: nowrap;
}

.settings-card button {
  width: 100%;
  padding: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  text-align: left;
}

.settings-card button:last-child {
  border-bottom: 0;
}

.settings-card .category-add-form button {
  width: auto;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: var(--green);
  color: white;
  font-weight: 840;
  text-align: center;
}

.settings-card .category-actions button {
  width: auto;
  min-height: 32px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  font-size: 0.74rem;
  font-weight: 820;
  text-align: center;
}

.settings-card .category-actions .danger-mini {
  border-color: rgba(168, 70, 63, 0.22);
  color: #a8463f;
}

.settings-card span,
.about-row span,
.rank-row span,
.insight-row span {
  color: var(--muted);
}

.backup-count-grid,
.backup-preview-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 10px 0;
}

.backup-count-grid > div,
.backup-preview-grid > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px 7px;
  border-radius: 12px;
  background: var(--soft);
  text-align: center;
}

.backup-count-grid span,
.backup-preview-grid span {
  overflow: hidden;
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-count-grid strong,
.backup-preview-grid strong {
  color: var(--ink);
  font-size: 0.88rem;
}

.backup-action-card > button > span {
  display: grid;
  flex: 1;
  gap: 2px;
  min-width: 0;
}

.backup-action-card > button b {
  overflow: hidden;
  color: var(--ink);
  font-size: 0.88rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-action-card > button small {
  overflow: hidden;
  font-size: 0.69rem;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.backup-action-card > button:disabled {
  cursor: wait;
  opacity: 0.62;
}

.backup-notice {
  margin-top: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 740;
  line-height: 1.45;
}

.backup-notice.is-success {
  border-color: rgba(47, 188, 112, 0.25);
  background: var(--green-soft);
  color: var(--green-deep);
}

.backup-notice.is-error {
  border-color: rgba(168, 70, 63, 0.22);
  background: var(--red-soft);
  color: #a8463f;
}

.backup-preview-card {
  border-color: rgba(47, 188, 112, 0.24);
}

.backup-preview-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.backup-preview-heading span,
.backup-preview-card > p,
.backup-safety-card p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.backup-preview-heading h2 {
  margin: 3px 0 0;
}

.backup-preview-heading > strong {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.68rem;
  white-space: nowrap;
}

.settings-card .backup-restore-button {
  min-height: 46px;
  margin-top: 12px;
  padding: 0 14px;
  border: 1px solid rgba(168, 70, 63, 0.2);
  border-radius: 14px;
  background: var(--red-soft);
  color: #a8463f;
  font-weight: 840;
  text-align: center;
}

.backup-confirm-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.backup-confirm-summary span {
  padding: 6px 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 760;
}

@media (max-width: 380px) {
  .backup-count-grid,
  .backup-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .backup-action-card > button small {
    white-space: normal;
  }
}

.confirm-field {
  display: grid;
  gap: 6px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 760;
}

.confirm-field input,
.confirm-field select {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
}

.danger-row,
.danger-button {
  color: #a8463f !important;
}

.warranty-item-button {
  width: 100%;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 12px;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 11px;
  color: var(--ink);
  text-align: left;
  touch-action: manipulation;
}

.warranty-item-button:active {
  transform: translateY(1px);
}

.warranty-thumb {
  position: relative;
  display: grid;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 15px;
  background:
    radial-gradient(circle at 72% 28%, rgba(255, 255, 255, 0.84) 0 12%, transparent 13%),
    linear-gradient(145deg, var(--photo-a), var(--photo-b));
  color: rgba(24, 26, 22, 0.72);
  font-size: 0.82rem;
  font-weight: 850;
}

.warranty-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.warranty-title-row {
  display: flex;
  min-width: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.warranty-title-row > strong {
  display: -webkit-box;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 0.9rem;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.warranty-item-meta,
.warranty-date,
.warranty-copy small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warranty-item-meta {
  font-size: 0.72rem;
}

.warranty-days {
  margin-top: 3px;
  color: var(--green-deep);
  font-size: 0.96rem;
  line-height: 1.15;
}

.warranty-days.expiring {
  color: #956b12;
}

.warranty-days.expired {
  color: #a8463f;
}

.warranty-days.none {
  color: #686f67;
}

.warranty-date {
  font-size: 0.74rem;
}

.warranty-copy small {
  font-size: 0.68rem;
}

.warranty-chevron {
  align-self: center;
  color: #9ba199;
  font-size: 1.2rem;
  line-height: 1;
}

.status-chip {
  flex: 0 0 auto;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.68rem;
  font-weight: 820;
  white-space: nowrap;
}

.status-chip.expiring {
  background: var(--amber-soft);
  color: #8f6b16;
}

.status-chip.expired {
  background: var(--red-soft);
  color: #a8463f;
}

.status-chip.no-date,
.status-chip.none,
.status-chip.undated {
  background: var(--soft);
  color: var(--muted);
}

.warranty-days.undated {
  color: #686f67;
}

.warranty-flow-shell {
  display: grid;
  gap: 14px;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}

.warranty-flow-intro {
  padding: 17px;
  border: 1px solid rgba(49, 181, 109, 0.16);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(235, 249, 240, 0.92));
  box-shadow: 0 12px 26px rgba(34, 54, 40, 0.06);
}

.warranty-flow-intro span {
  color: var(--green-deep);
  font-size: 0.72rem;
  font-weight: 820;
}

.warranty-flow-intro h2 {
  margin-top: 4px;
  font-size: 1.08rem;
}

.warranty-flow-intro p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.warranty-picker-list {
  display: grid;
  gap: 9px;
}

.warranty-picker-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 76px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--ink);
  text-align: left;
  box-shadow: 0 8px 20px rgba(28, 31, 27, 0.04);
}

.warranty-picker-item > span {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.warranty-picker-item strong,
.warranty-picker-item small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warranty-picker-item strong {
  font-size: 0.9rem;
}

.warranty-picker-item small {
  color: var(--muted);
  font-size: 0.72rem;
}

.warranty-picker-item em {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.7rem;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.warranty-picker-item em.is-tracked {
  background: var(--soft);
  color: var(--muted);
}

.warranty-tracking-form,
.document-upload-form {
  margin-bottom: max(22px, env(safe-area-inset-bottom));
}

.warranty-selected-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  padding: 12px;
  border-radius: 17px;
  background: var(--green-soft);
}

.warranty-selected-item > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.warranty-selected-item span,
.warranty-selected-item small {
  color: var(--muted);
  font-size: 0.7rem;
}

.warranty-selected-item strong {
  overflow: hidden;
  font-size: 0.94rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.warranty-tracking-fields {
  display: grid;
  gap: 13px;
}

.warranty-flow-note {
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

.document-upload-fields {
  display: grid;
  gap: 13px;
}

.document-file-picker {
  display: grid;
  justify-items: start;
  gap: 7px;
  padding: 14px;
  border: 1px dashed rgba(49, 181, 109, 0.34);
  border-radius: 16px;
  background: rgba(238, 249, 242, 0.62);
}

.document-file-picker button {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(49, 181, 109, 0.22);
  border-radius: 13px;
  background: var(--card);
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 820;
}

.document-file-picker p,
.document-pending-list > p {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.5;
}

.document-pending-list {
  display: grid;
  gap: 7px;
}

.document-pending-list > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
}

.document-pending-list span {
  color: var(--green-deep);
  font-size: 0.68rem;
  font-weight: 840;
}

.document-pending-list strong {
  overflow: hidden;
  font-size: 0.76rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.document-pending-list small {
  color: var(--muted);
  font-size: 0.68rem;
  white-space: nowrap;
}

.warranty-detail-summary.is-untracked {
  border-color: var(--line);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(244, 246, 243, 0.92));
}

.warranty-record-actions.is-single {
  grid-template-columns: minmax(0, 1fr);
}
.warranty-record-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.warranty-record-actions button {
  min-height: 42px;
  border: 1px solid rgba(49, 181, 109, 0.18);
  border-radius: 14px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.78rem;
  font-weight: 820;
}

.warranty-record-actions .is-danger {
  border-color: rgba(168, 70, 63, 0.2);
  background: var(--red-soft);
  color: #a8463f;
}
.detail-photo {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 20px;
  font-size: 2.25rem;
}

.detail-card {
  display: grid;
  gap: 12px;
}

.detail-topbar {
  align-items: center;
}

.detail-head-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
}

.detail-edit-button,
.detail-delete-button {
  min-height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 820;
}

.detail-edit-button {
  background: var(--green);
  color: #fff;
  box-shadow: 0 8px 18px rgba(49, 181, 109, 0.22);
}

.detail-delete-button {
  background: transparent;
  color: #a8463f;
}

.detail-hero {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.detail-copy {
  min-width: 0;
}

.detail-tags {
  justify-content: flex-start;
  margin-top: 0;
}

.detail-title {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  font-size: 1.48rem;
  line-height: 1.12;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.daily-hero-card {
  padding: 17px 16px;
  border: 1px solid rgba(49, 181, 109, 0.14);
  border-radius: 22px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98) 0%, rgba(235, 249, 241, 0.92) 100%);
  box-shadow: 0 14px 30px rgba(35, 34, 29, 0.07);
}

.detail-statistics-notice {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.detail-statistics-notice span {
  padding: 6px 9px;
  border: 1px solid rgba(120, 126, 118, 0.14);
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 760;
}

.daily-hero-card span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 760;
}

.daily-hero-card strong {
  display: block;
  margin-top: 6px;
  color: var(--green-deep);
  font-size: clamp(2.2rem, 12vw, 3.1rem);
  line-height: 0.96;
  overflow-wrap: anywhere;
}

.daily-hero-card p {
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.84rem;
}

.detail-key-metrics {
  gap: 8px;
}

.detail-key-metrics .metric {
  min-height: 70px;
  padding: 11px;
}

.detail-key-metrics .metric strong {
  font-size: 0.98rem;
}

.detail-identity-list {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.detail-identity-dot {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 760;
  line-height: 1.25;
}

.detail-identity-dot i {
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.detail-identity-dot.category {
  color: #557461;
}

.detail-identity-dot.status.valid,
.detail-identity-dot.warranty.valid {
  color: var(--green-deep);
}

.detail-identity-dot.status.idle,
.detail-identity-dot.warranty.expiring {
  color: #8f6b16;
}

.detail-identity-dot.status.muted,
.detail-identity-dot.warranty.none {
  color: var(--muted);
}

.detail-identity-dot.status.danger,
.detail-identity-dot.warranty.expired {
  color: #a8463f;
}

.detail-section {
  margin-top: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfaf7;
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.detail-section p,
.detail-section small {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  text-align: left;
}

.detail-section strong {
  display: block;
  margin-top: 4px;
}

.warranty-detail-card {
  padding: 15px;
  background: #fffefa;
}

.warranty-detail-card .detail-section-head {
  margin-bottom: 10px;
}

.warranty-main {
  color: var(--ink);
  font-size: 1.32rem;
  line-height: 1.16;
  letter-spacing: 0;
}

.warranty-until {
  margin-top: 7px;
}

.warranty-meta {
  margin-top: 4px;
}

.warranty-note {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(223, 220, 212, 0.72);
}

.trend-card {
  overflow: hidden;
  background: #fff;
}

.trend-card .detail-section-head {
  margin-bottom: 6px;
}

.trend-card .detail-section-head h3 {
  margin-bottom: 2px;
}

.trend-svg {
  display: block;
  width: 100%;
  height: auto;
  margin-top: 4px;
}

.trend-guide,
.trend-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.trend-guide {
  stroke: rgba(214, 220, 211, 0.9);
  stroke-width: 1.2;
}

.trend-guide.is-soft {
  stroke: rgba(214, 220, 211, 0.46);
  stroke-width: 1;
}

.trend-line {
  stroke: var(--green);
  stroke-width: 3.2;
}

.trend-dot {
  fill: #fff;
  stroke: var(--green);
  stroke-width: 2.4;
}

.trend-dot.is-end {
  fill: var(--green);
}

.trend-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 760;
}

.trend-labels strong {
  margin-top: 0;
  color: var(--green-deep);
  text-align: right;
}

.trend-empty {
  margin-top: 10px;
  padding: 12px;
  border-radius: 16px;
  background: var(--soft);
}

.trend-empty strong {
  margin-top: 0;
}

.detail-more {
  padding: 0;
  background: #fffefa;
}

.detail-more summary {
  display: flex;
  min-height: 60px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 13px;
  color: var(--ink);
  list-style: none;
  cursor: pointer;
  touch-action: manipulation;
}

.detail-more summary::-webkit-details-marker {
  display: none;
}

.detail-more summary::after {
  content: "›";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 180ms ease;
}

.detail-more[open] summary {
  border-bottom: 1px solid rgba(223, 220, 212, 0.72);
}

.detail-more[open] summary::after {
  transform: rotate(90deg);
}

.detail-more-summary {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.detail-more-title {
  margin-top: 0;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.2;
}

.detail-more-subtitle {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-extra-list {
  display: grid;
  padding: 3px 13px 12px;
}

.detail-extra-list div {
  display: grid;
  grid-template-columns: minmax(0, 0.76fr) minmax(0, 1.24fr);
  gap: 10px;
  align-items: start;
  padding: 9px 0;
  border-bottom: 1px solid rgba(223, 220, 212, 0.64);
}

.detail-extra-list div:last-child {
  border-bottom: 0;
}

.detail-extra-list span {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 720;
}

.detail-extra-list strong {
  margin-top: 0;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.86rem;
  line-height: 1.4;
}

.detail-extra-empty {
  margin: 0;
  padding: 0 13px 14px;
}

.detail-action-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.detail-action-grid button {
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--card);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 840;
  touch-action: manipulation;
}

.detail-action-grid button:nth-child(2) {
  background: var(--green-soft);
  color: var(--green-deep);
}

.detail-action-grid button:nth-child(3) {
  background: #f4f8f2;
}

.detail-action-grid .detail-danger-action {
  border-color: rgba(168, 70, 63, 0.18);
  background: var(--red-soft);
  color: #a8463f;
}

.action-grid,
.modal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.action-grid button,
.modal-actions button,
.primary-button,
.danger-button {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 830;
}

.primary-button {
  background: var(--green);
  color: white;
}

.danger-button {
  background: var(--red-soft);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.form-message {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--amber-soft);
  color: #7a5510;
  font-size: 0.82rem;
  font-weight: 760;
  line-height: 1.45;
}

.form-message[hidden] {
  display: none;
}

.field-error {
  display: block;
  color: #9d3630;
  font-size: 0.76rem;
  font-weight: 780;
  line-height: 1.4;
}

.field-error[hidden] {
  display: none;
}

input.is-invalid {
  border-color: #b94d45;
  box-shadow: 0 0 0 3px rgba(185, 77, 69, 0.12);
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 740;
}

select,
input,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fff;
  color: var(--ink);
}

.item-form input,
.item-form select,
.item-form textarea {
  font-size: 1rem;
}

.form-section {
  margin-top: 14px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fbfaf7;
}

.suggestion-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.suggestion-box[hidden] {
  display: none;
}

.suggestion-box button {
  min-height: 38px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 820;
}

.form-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.form-section-title span,
.field-note {
  color: var(--muted);
  font-size: 0.74rem;
}

.date-error {
  margin: 0;
  padding: 8px 10px;
  border-radius: 12px;
  background: var(--red-soft);
  color: #a8463f;
  font-size: 0.78rem;
  font-weight: 760;
}

.date-error[hidden] {
  display: none;
}

.switch-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  color: var(--ink);
}

.switch-row span {
  display: grid;
  gap: 3px;
}

.switch-row small {
  color: var(--muted);
  font-size: 0.74rem;
}

.switch-row input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  opacity: 0;
}

.switch-row i {
  position: relative;
  width: 52px;
  height: 32px;
  border-radius: 999px;
  background: #dedbd2;
}

.switch-row i::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 2px 7px rgba(25, 27, 23, 0.18);
  content: "";
  transition: transform 160ms ease;
}

.switch-row input:checked + i {
  background: var(--green);
}

.switch-row input:checked + i::after {
  transform: translateX(20px);
}

.switch-row:has(input:focus-visible) i {
  outline: 3px solid rgba(49, 181, 109, 0.24);
  outline-offset: 3px;
}

.statistics-settings-section .form-section-title {
  margin-bottom: 2px;
}

.warranty-fields {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.warranty-fields[hidden] {
  display: none;
}

.image-drop {
  margin-top: 14px;
  padding: 14px;
  border: 1px dashed #b6c9bb;
  border-radius: 18px;
  background: #fbfaf7;
}

.image-drop p {
  margin: 6px 0 12px;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.image-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}

.proof-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 10px;
}

.image-actions button {
  min-height: 44px;
  border-radius: 14px;
  background: var(--soft);
  color: var(--ink);
  font-weight: 780;
}

.proof-block {
  display: grid;
  gap: 10px;
}

.proof-list-title {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 820;
}

.attachment-list {
  display: grid;
  gap: 8px;
}

.attachment-item {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
  text-align: left;
}

.attachment-thumb {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.7rem;
  font-weight: 850;
}

.attachment-thumb.pdf {
  background: var(--red-soft);
  color: #a8463f;
}

.attachment-item strong,
.attachment-item span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-item span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.74rem;
}

.attachment-actions {
  display: grid;
  gap: 4px;
}

.attachment-actions button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 780;
}

.sell-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.confirm-layer {
  position: fixed;
  inset: 0;
  z-index: 50;
}

.confirm-scrim {
  position: absolute;
  inset: 0;
  background: rgba(25, 27, 23, 0.3);
}

.confirm-card {
  position: absolute;
  right: 14px;
  bottom: max(14px, env(safe-area-inset-bottom));
  left: 14px;
  padding: 16px;
  border-radius: 22px;
  background: white;
  box-shadow: 0 18px 42px rgba(35, 34, 29, 0.18);
}

.confirm-card p {
  margin-top: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.modal-actions .danger-confirm {
  background: rgba(168, 70, 63, 0.1);
  color: #a8463f;
}

@media (max-width: 374px) {
  .app-shell {
    padding-right: 10px;
    padding-left: 10px;
  }

  .topbar,
  .app-header,
  .page-head.app-header,
  .subpage-head {
    margin-right: -10px;
    margin-left: -10px;
    padding-right: 10px;
    padding-left: 10px;
  }

  .page-head.app-header {
    padding-right: 10px;
    padding-left: 10px;
  }

  .overview-card {
    padding: 14px;
  }

  .item-grid {
    gap: 8px;
  }

  .item-body {
    padding: 8px;
  }
}

@media (min-width: 720px) {
  .app-shell {
    padding: 24px 22px 44px;
  }

  .desktop-nav {
    position: sticky;
    top: 0;
    z-index: 7;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
    padding: 10px 0 12px;
    background: rgba(246, 245, 241, 0.94);
    backdrop-filter: blur(16px);
  }

  .desktop-nav-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 1 1 auto;
  }

  .desktop-nav button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: transparent;
    color: #5f665d;
    font-weight: 820;
  }

  .desktop-nav button.is-active {
    background: var(--green-soft);
    color: var(--green-deep);
  }

  .desktop-nav .desktop-add-button {
    flex: 0 0 auto;
    background: var(--green);
    color: white;
    box-shadow: 0 10px 22px rgba(49, 181, 109, 0.24);
  }

  .topbar,
  .app-header,
  .subpage-head {
    position: static;
    margin: 0;
    padding: 0 0 16px;
    background: transparent;
    backdrop-filter: none;
  }

  .topbar {
    align-items: flex-start;
  }

  .app-header {
    align-items: flex-start;
  }

  .navigation-drawer {
    width: min(42vw, 380px);
  }

  h1 {
    font-size: 1.55rem;
  }

  .collection-toolbar {
    grid-template-columns: minmax(240px, 0.8fr) minmax(0, 1.2fr);
    align-items: end;
  }

  .collection-search {
    grid-column: 1;
  }

  .collection-filter-stack {
    grid-column: 2;
    grid-row: 1 / span 2;
  }

  .collection-control-row {
    grid-column: 1;
  }

  .item-grid.is-grid,
  .wishlist-list.is-grid,
  .document-library-list.is-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
  }

  .collection-results.is-list {
    width: min(760px, 100%);
    margin-right: auto;
    margin-left: auto;
  }

  .bottom-nav {
    display: none;
  }

  .app-update-prompt {
    right: 24px;
    bottom: 24px;
    left: auto;
    width: 420px;
  }

  body.subview-open .desktop-nav {
    display: none;
  }

  .stat-grid,
  .more-stats-grid,
  .warranty-overview,
  .metric-grid,
  .sell-result {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .stats-core {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .more-stats .more-stats-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .proof-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .view.subview {
    width: min(760px, 100%);
    margin: 0 auto;
  }

  .detail-hero {
    grid-template-columns: 148px minmax(0, 1fr);
  }

  .detail-title {
    font-size: 1.72rem;
  }

  .confirm-card {
    right: 24px;
    left: auto;
    width: 420px;
  }
}

@media (pointer: coarse) and (max-width: 960px) and (max-height: 600px) {
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .view.subview {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .global-navigation-scrim,
  .navigation-drawer,
  .search-page {
    transition-duration: 1ms;
  }
}

@media (min-width: 1040px) {
  .item-grid.is-grid,
  .wishlist-list.is-grid,
  .document-library-list.is-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

/* Smart import v1.1 */
body.smart-import-open {
  overflow: hidden;
}

.smart-import-card {
  margin: 0 0 18px;
  padding: 16px;
  border: 1px solid #dcece2;
  border-radius: 18px;
  background: linear-gradient(145deg, #f9fffb 0%, #f3faf5 100%);
}

.smart-import-card-head,
.smart-import-sheet-head,
.warranty-documents-actions {
  display: flex;
  align-items: center;
}

.smart-import-card-head {
  gap: 12px;
}

.smart-import-card-head > div,
.smart-import-sheet-head > div,
.smart-import-file-copy {
  flex: 1;
  min-width: 0;
}

.smart-import-card-head > div > span,
.smart-import-sheet-head > div > span {
  display: block;
  margin-bottom: 3px;
  color: var(--green-deep);
  font-size: 0.74rem;
  font-weight: 750;
}

.smart-import-card h3,
.smart-import-sheet-head h2 {
  margin: 0;
  letter-spacing: 0;
}

.smart-import-card h3 {
  font-size: 1rem;
}

.smart-import-card-head p,
.smart-import-sheet-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.79rem;
  line-height: 1.45;
}

.smart-import-card-head > button,
.warranty-documents-actions button {
  flex: 0 0 auto;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid #cce7d7;
  border-radius: 12px;
  background: #fff;
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 760;
}

.smart-import-content {
  margin-top: 13px;
}

.smart-import-empty,
.smart-import-no-suggestion,
.smart-import-storage-note,
.smart-import-notice {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.55;
}

.smart-import-storage-note {
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid rgba(49, 181, 109, 0.13);
}

.smart-import-notice {
  margin: 10px 0 0;
  padding: 9px 11px;
  border-radius: 10px;
  background: var(--amber-soft);
  color: #82611e;
}

.smart-import-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.82);
}

.smart-import-summary > span {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 850;
}

.smart-import-summary.is-loading > span {
  animation: smart-import-pulse 1.1s ease-in-out infinite;
}

.smart-import-summary div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.smart-import-summary strong,
.smart-import-summary small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-import-summary strong {
  font-size: 0.88rem;
}

.smart-import-summary small {
  color: var(--muted);
  font-size: 0.74rem;
}

.smart-import-applied,
.smart-import-suggestions {
  margin-top: 12px;
}

.smart-import-multi {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.smart-import-order-meta,
.smart-import-multi-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.smart-import-item-choices {
  display: grid;
  gap: 7px;
}

.smart-import-item-choice {
  display: flex;
  min-width: 0;
  min-height: 54px;
  padding: 9px 10px;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
  cursor: pointer;
}

.smart-import-item-choice:has(input:checked) {
  border-color: #bfe3cc;
  background: #fbfffc;
}

.smart-import-item-choice input {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  accent-color: var(--green);
}

.smart-import-item-choice > span {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.smart-import-item-choice strong,
.smart-import-item-choice small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-import-item-choice strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.smart-import-item-choice small {
  color: var(--muted);
  font-size: 0.72rem;
}

.smart-import-items-submit {
  min-height: 44px;
  border-radius: 12px;
  font-weight: 780;
}

.smart-import-items-submit:disabled {
  cursor: default;
  opacity: 0.5;
}

.smart-import-confirmed > button {
  min-height: 42px;
  margin-top: 10px;
  padding: 0 13px;
  border: 1px solid rgba(49, 181, 109, 0.2);
  border-radius: 999px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-weight: 810;
}

.smart-import-review-order,
.smart-import-review-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.smart-import-review-order,
.smart-import-review-item {
  padding: 11px;
  border: 1px solid #e5e1d9;
  border-radius: 14px;
  background: #fff;
}

.smart-import-review-order label,
.smart-import-review-item label {
  display: grid;
  min-width: 0;
  gap: 5px;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
}

.smart-import-review-order label:first-child,
.smart-import-review-order label:last-child,
.smart-import-review-item > strong,
.smart-import-review-item .is-wide {
  grid-column: 1 / -1;
}

.smart-import-review-order input,
.smart-import-review-item input,
.smart-import-review-item select {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid #dcd8d0;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
}

.smart-import-review-items {
  display: grid;
  gap: 9px;
}

.smart-import-review-item > strong {
  color: var(--green-dark);
  font-size: 0.76rem;
}

.smart-import-review-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 8px;
}

.smart-import-review-actions button {
  min-width: 0;
  min-height: 44px;
  border-radius: 12px;
  font-weight: 760;
}

@media (max-width: 370px) {
  .smart-import-review-order,
  .smart-import-review-item {
    gap: 8px 7px;
    padding: 10px;
  }

  .smart-import-review-order input,
  .smart-import-review-item input,
  .smart-import-review-item select {
    padding-inline: 8px;
  }
}

.smart-import-applied {
  display: grid;
  gap: 3px;
  padding: 0 2px;
  color: var(--muted);
  font-size: 0.77rem;
}

.smart-import-applied strong {
  color: var(--ink);
  font-size: 0.82rem;
}

.smart-import-draft-confirm {
  width: 100%;
  min-height: 44px;
  margin-top: 4px;
  border-radius: 14px;
}

.smart-import-section-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.smart-import-section-label strong {
  font-size: 0.85rem;
}

.smart-import-section-label span {
  color: var(--muted);
  font-size: 0.72rem;
}

.smart-import-suggestion-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 48px;
  padding: 8px 3px;
  border-top: 1px solid rgba(232, 229, 221, 0.8);
  cursor: pointer;
}

.smart-import-suggestion-row input {
  width: 19px;
  height: 19px;
  flex: 0 0 19px;
  accent-color: var(--green);
}

.smart-import-suggestion-row > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.smart-import-suggestion-row small {
  color: var(--muted);
  font-size: 0.72rem;
}

.smart-import-suggestion-row strong {
  overflow: hidden;
  font-size: 0.84rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-import-files {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.smart-import-file {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) minmax(104px, auto) 34px;
  align-items: center;
  gap: 9px;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.smart-import-file.is-reading {
  opacity: 0.72;
}

.smart-import-file-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-deep);
  font-size: 0.66rem;
  font-weight: 850;
}

.smart-import-file-copy {
  display: grid;
  gap: 3px;
}

.smart-import-file-copy strong,
.smart-import-file-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.smart-import-file-copy strong {
  font-size: 0.81rem;
}

.smart-import-file-copy small {
  color: var(--muted);
  font-size: 0.7rem;
}

.smart-import-category-select {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 0.66rem;
}

.smart-import-category-select select {
  width: 100%;
  min-height: 36px;
  padding: 0 25px 0 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background-color: #fafaf7;
  color: var(--ink);
  font-size: 0.74rem;
}

.smart-import-remove {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
}

.smart-import-layer[hidden] {
  display: none;
}

.smart-import-layer {
  position: fixed;
  z-index: 40;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
}

.smart-import-scrim {
  position: absolute;
  inset: 0;
  background: rgba(25, 29, 26, 0.3);
  backdrop-filter: blur(3px);
}

.smart-import-sheet {
  position: relative;
  display: flex;
  width: min(680px, 100%);
  max-height: min(88vh, 820px);
  max-height: min(88dvh, 820px);
  flex-direction: column;
  padding: 18px 14px max(18px, env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--bg);
  box-shadow: 0 -18px 50px rgba(25, 29, 26, 0.16);
}

.smart-import-sheet-head {
  gap: 12px;
  padding: 0 3px 14px;
}

.smart-import-sheet-head h2 {
  font-size: 1.2rem;
}

.smart-import-sheet-head > button {
  display: grid;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  font-size: 1.25rem;
}

.smart-import-sheet-body {
  min-height: 0;
  overflow-y: auto;
}

.smart-import-sheet .smart-import-card {
  margin: 0;
}

.smart-import-sheet-actions {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 10px;
  margin-top: 16px;
}

.smart-import-sheet-actions button {
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  font-weight: 780;
}

.smart-import-sheet-actions .primary-button {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}

.smart-import-sheet-actions button:disabled {
  cursor: default;
  opacity: 0.5;
}

.detail-smart-import {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
  min-height: 58px;
  margin: 14px 0;
  padding: 10px 14px;
  align-items: center;
  column-gap: 10px;
  border: 1px solid #dcece2;
  border-radius: 15px;
  background: #f8fcf9;
  color: var(--ink);
  text-align: left;
}

.detail-smart-import span,
.detail-smart-import small {
  min-width: 0;
}

.detail-smart-import span {
  font-weight: 800;
}

.detail-smart-import small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-smart-import strong {
  grid-column: 2;
  grid-row: 1 / span 2;
  color: var(--green-deep);
  font-size: 1.2rem;
}

.warranty-documents-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
}

.warranty-documents-actions > span {
  color: var(--muted);
  font-size: 0.75rem;
  white-space: nowrap;
}

.warranty-documents-actions button {
  min-height: 36px;
  padding-inline: 11px;
}

@keyframes smart-import-pulse {
  50% {
    transform: scale(0.88);
    opacity: 0.65;
  }
}

@media (max-width: 430px) {
  .smart-import-card {
    padding: 14px;
    border-radius: 16px;
  }

  .smart-import-card-head {
    align-items: flex-start;
  }

  .smart-import-card-head > button {
    min-height: 44px;
    padding-inline: 11px;
  }

  .smart-import-file {
    grid-template-columns: 36px minmax(0, 1fr) 44px;
  }

  .smart-import-category-select {
    grid-column: 2 / span 2;
    grid-row: 2;
  }

  .smart-import-remove {
    grid-column: 3;
    grid-row: 1;
  }

  .warranty-documents-head {
    align-items: flex-start;
  }

  .warranty-documents-actions {
    display: grid;
    justify-items: end;
  }
}

@media (pointer: coarse) {
  .attachment-actions button,
  .warranty-file-actions button {
    min-width: 44px;
    min-height: 44px;
  }

  .smart-import-remove {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 719px) {
  body:has(.view[data-view="edit"].is-active) .app-shell {
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
  }

  .item-form[data-mode="edit"] {
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .item-form[data-mode="edit"] .editor-save-actions {
    display: block;
    position: fixed;
    right: auto;
    bottom: calc(38px + env(safe-area-inset-bottom));
    left: 50%;
    z-index: 9;
    width: 60vw;
    max-width: 280px;
    margin: 0;
    transform: translateX(-50%);
    pointer-events: none;
  }

  .item-form[data-mode="edit"] .editor-save-actions > [data-back] {
    display: none;
  }

  .item-form[data-mode="edit"] .editor-save-actions .primary-button {
    width: 100%;
    min-height: 54px;
    pointer-events: auto;
    border: 1px solid transparent;
    border-radius: 999px;
    transition: background-color 140ms ease, color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
  }

  .item-form[data-mode="edit"][data-dirty="false"] .editor-save-actions .primary-button {
    border-color: rgba(49, 181, 109, 0.34);
    background: rgba(255, 255, 255, 0.96);
    color: var(--green-deep);
    box-shadow: 0 8px 22px rgba(31, 47, 36, 0.1);
  }

  .item-form[data-mode="edit"][data-dirty="true"] .editor-save-actions .primary-button {
    background: var(--green);
    color: #fff;
    box-shadow: 0 12px 26px rgba(49, 181, 109, 0.3);
  }

  .item-form[data-mode="edit"] .editor-save-actions .primary-button:disabled {
    cursor: default;
    opacity: 0.5;
    box-shadow: none;
  }
}

@media (pointer: coarse) and (max-width: 719px) {
  html {
    scrollbar-width: none;
  }

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

  body:has(input:not([type="file"]):focus, textarea:focus) .bottom-nav {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + max(20px, env(safe-area-inset-bottom))));
  }

}

@media (min-width: 760px) {
  .smart-import-layer {
    align-items: center;
    padding: 24px;
  }

  .smart-import-sheet {
    border-radius: 22px;
    padding: 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .smart-import-summary.is-loading > span {
    animation: none;
  }
}

/* Home-only visual system; other views retain their established surfaces. */
.home-page {
  --home-ink: #2d352f;
  --home-muted: #686d64;
  --home-accent: #405744;
  --home-line: #dedfd6;
  --home-soft: #edf0e9;
  color: var(--home-ink);
}
.home-page .app-header { margin: 0; padding: 10px 0 10px; gap: 14px; background: #f6f5f1; }
.home-page .app-header h1 { font-size: 25px; font-weight: 760; }
.home-page .navigation-menu-button { border-radius: 12px; box-shadow: none; border-color: var(--home-line); color: var(--home-ink); background: #fffefa; }
.home-page .home-search-button { border-radius: 12px; box-shadow: none; border-color: var(--home-line); color: var(--home-ink); background: #fffefa; }
.home-summary { padding: 12px 0 0; margin-bottom: 12px; border-top: 1px solid var(--home-line); border-bottom: 1px solid var(--home-line); }
.home-summary-values { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 14px; align-items: end; }
.home-summary-values > div { min-width: 0; }
.home-summary-values span { display: block; color: var(--home-muted); font-size: 12px; }
.home-summary-values strong { display: block; margin-top: 5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; line-height: 1.2; }
.home-asset-value strong { font-size: 34px; font-weight: 720; color: var(--home-accent); }
.home-daily-value { border-left: 1px solid var(--home-line); padding-left: 14px; padding-bottom: 3px; }
.home-daily-value strong { font-size: 23px; font-weight: 650; }
.home-summary-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 0; margin-top: 3px; color: var(--home-muted); font-size: 11px; }
.home-item-count strong { font-size: 15px; margin-left: 5px; color: var(--home-ink); }
.home-status-counts { display: flex; flex-wrap: wrap; gap: 12px; }
.home-status-counts span { display: inline-flex; align-items: center; gap: 4px; }
.home-status-counts span::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #527658; }
.home-status-counts .idle::before { background: #a28b61; }
.home-status-counts .sold::before { background: #929590; }
.home-status-counts b { color: var(--home-ink); font-weight: 600; }
.home-page .home-toolbar { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; margin: 0; }
.home-page .collection-toolbar-host { margin-bottom: 4px; }
.home-page .home-category-rail { display: flex; width: 100%; gap: 6px; padding: 0 0 2px; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #d2d7cb transparent; }
.home-page .collection-filter-rail button { min-height: 44px; padding: 8px 13px; border: 1px solid transparent; background: transparent; color: var(--home-muted); border-radius: 8px; font-size: 13px; white-space: nowrap; }
.home-page .home-category-rail button { flex: 0 0 auto; }
.home-page .collection-filter-rail button.is-active { color: var(--home-accent); background: #e3e9dc; border-color: #d8dfd0; }
.home-search-icon { width: 14px; height: 14px; border: 1.6px solid currentColor; border-radius: 50%; position: relative; flex: 0 0 auto; color: var(--home-muted); }
.home-search-icon::after { content: ""; position: absolute; width: 6px; height: 1.6px; background: currentColor; right: -5px; bottom: -2px; transform: rotate(45deg); }
.home-browse-controls { display: flex; align-items: center; gap: 8px; min-width: 0; }
.home-page .home-status-filter { flex: 1 1 auto; gap: 2px; overflow: visible; }
.home-page .home-status-filter button { flex: 1 1 0; min-width: 0; max-width: none; padding: 0 4px; font-size: 12px; }
.home-tools { display: flex; flex: 0 0 auto; align-items: center; gap: 4px; margin-left: auto; }
.home-sort-menu { position: relative; }
.home-sort-menu > summary { list-style: none; }
.home-sort-menu > summary::-webkit-details-marker { display: none; }
.home-tool-button { display: grid; width: 44px; min-width: 44px; height: 44px; place-items: center; padding: 0; border: 1px solid transparent; border-radius: 8px; background: transparent; color: var(--home-muted); }
.home-tool-button:is(:hover, .is-active), .home-sort-menu[open] > summary { border-color: var(--home-line); background: #fffefa; color: var(--home-accent); }
.home-tool-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.home-sort-popover { position: absolute; z-index: 9; top: calc(100% + 7px); right: 0; width: min(260px, calc(100vw - 32px)); padding: 10px; border: 1px solid var(--home-line); border-radius: 10px; background: #fffefa; box-shadow: 0 14px 34px rgba(44, 51, 45, 0.16); }
.home-sort-section { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px; }
.home-sort-section + .home-sort-section { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--home-line); }
.home-sort-section > strong { grid-column: 1 / -1; padding: 4px 8px 5px; color: var(--home-muted); font-size: 11px; }
.home-sort-option { position: relative; min-height: 40px; padding: 7px 27px 7px 8px; border-radius: 7px; background: transparent; color: var(--home-ink); text-align: left; font-size: 12px; }
.home-sort-option:is(:hover, .is-selected) { background: var(--home-soft); color: var(--home-accent); }
.home-sort-option.is-selected::after { content: ""; position: absolute; right: 10px; top: 13px; width: 8px; height: 4px; border-bottom: 1.8px solid currentColor; border-left: 1.8px solid currentColor; transform: rotate(-45deg); }
.home-page :is(button, summary, input, select):focus-visible { outline: 2px solid #526e53; outline-offset: 3px; }
.home-page .home-results-heading { margin: 10px 0 10px; }
.home-page .home-results-heading h2 { font-size: 15px; font-weight: 700; }
.home-page .home-results-heading > span { font-size: 12px; color: var(--home-muted); }
.home-active-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: -6px 0 10px; font-size: 11px; color: var(--home-muted); }
.home-active-filters[hidden] { display: none; }
.home-active-filters > span { padding: 5px 8px; background: #e9ece4; border-radius: 4px; overflow-wrap: anywhere; max-width: 100%; }
.home-active-filters button { margin-left: auto; min-height: 44px; padding: 5px 0 5px 8px; background: transparent; color: var(--home-accent); text-decoration: underline; text-underline-offset: 3px; }
.item-collection-view .item-grid { gap: 12px; padding-bottom: 28px; }
.item-collection-view .item-card { border-color: #e1e3da; border-radius: 12px; background: #fffefa; box-shadow: 0 3px 10px #303b2810; }
.item-collection-view .item-card > button { height: 100%; border: 0; border-radius: 12px; }
.item-collection-view .item-card > button:hover { background: #fdfdf9; }
.item-collection-view .item-card:focus-within { outline: 2px solid var(--home-accent); outline-offset: 3px; }
.item-collection-view .item-photo { aspect-ratio: 5 / 4; margin: 7px 7px 0; border-radius: 8px; background: #e8ece5; color: #586751; font-size: 26px; font-weight: 600; overflow: hidden; }
.item-collection-view .item-photo:not(.has-main-image)::after { content: ""; position: absolute; inset: 13px; border: 1px solid #cbd3c4; border-radius: 4px; pointer-events: none; }
.item-collection-view .item-photo.has-main-image { background: #f0f0eb; }
.item-collection-view .item-photo img { width: 100%; height: 100%; object-fit: contain; }
.item-collection-view .item-body { padding: 11px 10px 13px; }
.home-item-category { font-size: 10px; color: var(--home-muted); margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.item-collection-view .item-title { font-size: 14px; font-weight: 700; line-height: 1.4; min-height: 39px; max-height: 39px; overflow-wrap: anywhere; color: var(--home-ink); }
.item-collection-view .card-row { gap: 5px; margin-top: 9px; min-height: 21px; flex-wrap: wrap; }
.item-collection-view .pill { font-size: 10px; padding: 3px 6px; border-radius: 4px; color: #62695e; background: #eeeee8; }
.item-collection-view .pill.green { color: #3c6142; background: #e6eee1; }
.item-collection-view .pill.amber { color: #80602c; background: #f3ead8; }
.item-collection-view .pill.red { color: #954338; background: #f7e9e5; }
.home-held-days { font-size: 10px; color: var(--home-muted); white-space: nowrap; }
.item-collection-view .cost-list { gap: 6px; margin-top: 11px; padding-top: 10px; border-top: 1px solid #ecece4; font-size: 10px; color: var(--home-muted); }
.item-collection-view .cost-list span { gap: 4px; align-items: baseline; flex-wrap: wrap; }
.item-collection-view .cost-list strong { font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.item-collection-view .price { font-size: 12px; font-weight: 600; color: var(--home-ink); }
.item-collection-view .daily-line strong { font-size: 17px; font-weight: 700; color: var(--home-accent); }
.item-collection-view .valuation-line { opacity: 1; color: var(--home-muted); }
.item-collection-view .item-grid.is-list { grid-template-columns: minmax(0, 1fr); gap: 9px; }
.item-collection-view .item-grid.is-list .item-card > button { grid-template-columns: 90px minmax(0, 1fr); align-items: center; }
.item-collection-view .item-grid.is-list .item-photo { width: 78px; height: 96px; margin: 10px 0 10px 10px; font-size: 20px; }
.item-collection-view .item-grid.is-list .item-photo:not(.has-main-image)::after { inset: 8px; }
.item-collection-view .item-grid.is-list .item-body { padding: 12px; }
.item-collection-view .item-grid.is-list .item-title { min-height: 0; max-height: 40px; font-size: 14px; }
.item-collection-view .item-grid.is-list .home-item-category { margin-bottom: 3px; }
.item-collection-view .item-grid.is-list .card-row { margin-top: 5px; justify-content: flex-start; gap: 10px; }
.item-collection-view .item-grid.is-list .cost-list { display: flex; flex-wrap: wrap; column-gap: 14px; row-gap: 5px; border: 0; padding: 0; margin-top: 8px; }
.item-collection-view .item-grid.is-list .cost-list > span { display: flex; gap: 5px; }
.item-collection-view .item-grid.is-list .daily-line { margin-left: auto; }
.item-collection-view .item-grid.is-list .daily-line strong { font-size: 16px; }
.home-empty-state { grid-column: 1 / -1; padding: 26px 16px 30px; text-align: center; border-top: 1px solid var(--home-line); }
.home-empty-mark { position: relative; width: 56px; height: 48px; border: 1.5px solid #809074; border-radius: 6px; margin: 8px auto 23px; background: #e7ecdf; transform: rotate(-5deg); }
.home-empty-mark::before { content: ""; position: absolute; left: 5px; right: 5px; height: 6px; top: -7px; border: 1px solid #a3ae98; border-radius: 3px 3px 0 0; background: #f9faf5; }
.home-empty-mark span { position: absolute; top: 17px; left: 18px; width: 18px; height: 8px; border: 1px solid #809074; border-radius: 2px; background: #fafbf7; }
.home-empty-mark.is-search { border-radius: 50%; width: 38px; height: 38px; transform: none; }
.home-empty-mark.is-search::before { width: 19px; height: 3px; top: auto; bottom: -6px; left: 28px; border: 0; background: #809074; transform: rotate(45deg); }
.home-empty-mark.is-search span { display: none; }
.home-empty-state h2 { font-size: 19px; font-weight: 650; color: var(--home-ink); }
.home-empty-state p { color: var(--home-muted); font-size: 13px; margin: 9px 0 20px; line-height: 1.6; }
.home-empty-action { min-height: 46px; padding: 11px 22px; border-radius: 8px; background: var(--home-accent); color: #fffefa; font-size: 13px; font-weight: 650; }
@media (max-width: 719px) {
  .item-collection-view .item-grid:not(.is-list) .item-photo { aspect-ratio: 1; }
}
@media (min-width: 720px) {
  .home-page { max-width: 1080px; margin: 0 auto; }
  .home-page .app-header { padding-top: 18px; padding-bottom: 24px; }
  .home-page .app-header h1 { font-size: 29px; }
  .home-summary { padding-top: 18px; margin-bottom: 18px; }
  .home-summary-values { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .home-asset-value strong { font-size: 48px; }
  .home-daily-value strong { font-size: 32px; }
  .home-summary-footer { font-size: 13px; padding: 18px 0; }
  .home-status-counts { gap: 24px; }
  .home-page .home-toolbar { grid-template-columns: minmax(0, 1fr) auto; column-gap: 20px; align-items: center; }
  .home-page .home-category-rail { grid-column: 1; grid-row: 1; }
  .home-page .home-browse-controls { grid-column: 2; grid-row: 1; }
  .item-collection-view .item-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
  .item-collection-view .item-body { padding: 14px; }
  .item-collection-view .item-title { font-size: 16px; min-height: 45px; max-height: 45px; }
  .item-collection-view .home-item-category { font-size: 12px; }
  .item-collection-view .cost-list { font-size: 12px; }
  .item-collection-view .price { font-size: 14px; }
  .item-collection-view .daily-line strong { font-size: 20px; }
  .item-collection-view .item-grid.is-list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .home-empty-state { padding: 46px 20px; }
}

/* Search is a focused task screen; item cards keep the approved Home visual language. */
.home-page.is-search-underlay { display: block; pointer-events: none; }
.view.subview.search-page {
  position: fixed;
  inset: 0;
  z-index: 12;
  width: 100%;
  max-width: none;
  height: 100dvh;
  margin: 0;
  padding:
    max(12px, env(safe-area-inset-top))
    max(14px, env(safe-area-inset-right))
    max(24px, env(safe-area-inset-bottom))
    max(14px, env(safe-area-inset-left));
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  visibility: hidden;
  pointer-events: none;
  background: var(--bg);
  transform: translate3d(100%, 0, 0);
  transition: transform 230ms cubic-bezier(0.22, 1, 0.36, 1);
  scrollbar-width: none;
  --home-ink: #2d352f;
  --home-muted: #686d64;
  --home-accent: #405744;
  --search-ink: #2d352f;
  --search-muted: #686d64;
  --search-line: #dedfd6;
}
.view.subview.search-page::-webkit-scrollbar { display: none; }
.view.subview.search-page:is(.is-active, .is-exiting) { display: block; visibility: visible; }
.view.subview.search-page.is-active { pointer-events: auto; }
.view.subview.search-page.is-open { transform: translate3d(0, 0, 0); }
.search-page-head { position: sticky; top: 0; z-index: 5; display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 10px; margin: 0 -14px; padding: 8px 14px 12px; background: rgba(246, 245, 241, 0.96); backdrop-filter: blur(16px); }
.search-page-head .back-button { width: 44px; min-width: 44px; height: 44px; border-radius: 12px; box-shadow: none; }
.search-primary-input { min-width: 0; min-height: 48px; border-radius: 12px; border-color: var(--search-line); background: #fffefa; color: var(--search-muted); }
.search-primary-input input { font-size: 15px; color: var(--search-ink); }
.search-primary-input input:focus,
.search-primary-input input:focus-visible { border: 0; outline: 0; background: transparent; box-shadow: none; }
.search-page-body { display: grid; width: 100%; min-width: 0; gap: 0; max-width: 1080px; margin: 0 auto; }
.search-results-heading { margin: 17px 0 12px; }
.search-results-heading h1 { font-size: 15px; color: var(--search-ink); }
.search-results-heading span { font-size: 12px; color: var(--search-muted); }
.search-results-shell { width: 100%; max-width: none; }
.search-results-shell .item-grid { padding-bottom: 28px; }
.search-empty-state { min-height: min(62vh, 520px); border: 0; background: transparent; box-shadow: none; }
.search-empty-state.is-idle { color: var(--search-muted); }
.search-page :is(button, select):focus-visible { outline: 2px solid #526e53; outline-offset: 3px; }

@media (min-width: 720px) {
  .search-page-head { max-width: 1080px; margin: 0 auto; padding: 18px 0 16px; }
}
@media (min-width: 1100px) {
  .item-collection-view .item-grid:not(.is-list) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
