.home { background: radial-gradient(ellipse at 12% -18%, #2b2029 0, transparent 43rem), var(--ui-bg); }
.home-hero {
  display: grid;
  grid-template-columns: minmax(0,1.1fr) minmax(0,.9fr);
  min-height: clamp(13rem, 26vw, 19rem);
  margin: clamp(1.05rem, 3vw, 2.65rem) 0 1.15rem;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid var(--ui-stroke);
  border-radius: calc(var(--ui-radius) + .35rem);
  background: #201b23;
}
.home-hero-copy {
  align-self: center;
  padding: clamp(1rem, 3.4vw, 3rem);
  z-index: 1;
}
.home-hero .ui-display { font-size: clamp(2.15rem, 4.75vw, 4rem); }
.home-hero p { max-width: 25rem; color: var(--ui-muted); margin: .8rem 0 0; font-size: clamp(.91rem, 1.55vw, 1.1rem); }
.home-hero-art {
  min-width: 0; position: relative; overflow: hidden; isolation: isolate;
  background: radial-gradient(ellipse at center, #47343d, #19171d 68%);
}
.home-hero-art img {
  display: block; width: 100%; height: 100%; position: absolute; inset: 0;
  object-fit: cover; object-position: 50% 50%;
}
.home-hero-art::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, #201b238c, transparent 27%), linear-gradient(0deg, #17141a55, transparent 42%);
  pointer-events: none;
}
.modules { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .7rem; }
.module {
  --module-tone: var(--ui-accent);
  display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: .85rem;
  min-height: 6.3rem;
  color: inherit; background: var(--ui-surface); border: 1px solid var(--ui-stroke);
  padding: 1rem; border-radius: var(--ui-radius);
  transition: background-color .18s ease, border-color .18s ease;
}
.module:hover { border-color: var(--module-tone); background: var(--ui-raised); }
.primary-module {
  grid-column: span 2; border-color: #71535b;
  background: linear-gradient(95deg,#30222b,var(--ui-surface));
}
.bottle-module { --module-tone: #f2bd92; }
.seal-module { --module-tone: #f4a6bd; }
.game-module { --module-tone: #ceb9fa; }
.report-module { --module-tone: #a9dac8; }
.module h2 { margin: 0 0 .28rem; line-height: 1.25; font-weight: 690; font-size: 1.15rem; }
.module p { margin: 0; color: var(--ui-muted); font-size: .89rem; line-height: 1.5; }
.module-icon {
  position: relative; display: grid; place-items: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: .86rem;
  background: color-mix(in srgb, var(--module-tone), var(--ui-surface) 89%);
  color: var(--module-tone); border: 1px solid color-mix(in srgb, var(--module-tone), var(--ui-stroke) 78%);
}
.module-icon::before, .module-icon::after { content: ""; position: absolute; }
.icon-profile::before { width: .58rem; height: .58rem; top: .66rem; border: 1.5px solid currentColor; border-radius: 50%; }
.icon-profile::after { width: 1.09rem; height: .53rem; bottom: .65rem; border: 1.5px solid currentColor; border-bottom: 0; border-radius: .55rem .55rem 0 0; }
.icon-bottle::before { width: .88rem; height: 1.04rem; bottom: .61rem; border: 1.5px solid currentColor; border-radius: .27rem .27rem .22rem .22rem; background: linear-gradient(0deg,currentColor 24%,transparent 24%); }
.icon-bottle::after { width: .43rem; height: .25rem; top: .68rem; border: 1.5px solid currentColor; border-radius: .14rem; }
.icon-seal::before { width: 1.02rem; height: 1.02rem; border: 1.4px dashed currentColor; border-radius: 50%; }
.icon-seal::after { width: .43rem; height: .43rem; background: currentColor; transform: rotate(45deg); border-radius: .09rem; }
.icon-game::before { width: 1.12rem; height: 1.12rem; border: 1.5px solid currentColor; border-radius: .27rem; transform: rotate(-12deg); }
.icon-game::after { width: .22rem; height: .22rem; border-radius: 50%; background: currentColor; box-shadow: -.25rem -.28rem currentColor, .25rem .28rem currentColor; }
.icon-report::before { width: .9rem; height: 1.17rem; border: 1.5px solid currentColor; border-radius: .18rem; }
.icon-report::after { width: .42rem; height: 1px; background: currentColor; top: 1.08rem; box-shadow: 0 .25rem currentColor, 0 .5rem currentColor; }
.archive {
  scroll-margin-top: .8rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .8rem 1.35rem;
  padding: 1.15rem;
  margin: 1.2rem 0 1.1rem;
  border: 1px solid var(--ui-stroke); border-radius: var(--ui-radius);
  background: #1a181e;
}
.archive-copy { align-self: center; flex: 1 1 17rem; }
.archive h2, #import-dialog h2 { margin: 0 0 .34rem; font-size: 1.12rem; }
.archive p, #import-dialog p { margin: 0; font-size: .91rem; color: var(--ui-muted); }
.archive-controls { align-self: center; }
#archive-status:not(:empty) { margin-top: .6rem; }
#import-dialog .actions { margin-top: .9rem; }
#import-summary {
  width: 100%;
  margin-block: .75rem;
  border-collapse: collapse;
  font-size: .9rem;
  font-variant-numeric: tabular-nums;
}
#import-summary :is(th, td) { padding: .4rem .35rem; border-bottom: 1px solid var(--ui-stroke); text-align: start; }
#import-summary thead th { color: var(--ui-muted); font-size: .8rem; }
#import-summary tbody th { font-weight: 500; }
.footer { border-top: 1px solid var(--ui-stroke); padding: .8rem 0 1.4rem; font-size: .85rem; color: var(--ui-muted); }
#offline-status { display: inline-flex; gap: .5rem; align-items: center; }
#offline-status::before { content: ""; width: .42rem; height: .42rem; border-radius: 50%; background: #a9dac8; }
@media (max-width: 720px) {
  .modules { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 540px) {
  .home-hero { grid-template-columns: minmax(0,1fr) minmax(5.25rem,.56fr); min-height: 10.1rem; }
  .home-hero-copy { padding-inline: .94rem 0; }
  .home-hero .ui-display { font-size: clamp(1.65rem, 6.9vw, 2.25rem); }
  .home-hero p { margin-top: .58rem; }
  .home-hero-art img { object-position: 48% center; }
  .modules { grid-template-columns: minmax(0,1fr); gap: .52rem; }
  .primary-module { grid-column: auto; }
  .module { min-height: 4.55rem; padding: .7rem .8rem; gap: .72rem; }
  .module h2 { font-size: 1.06rem; margin-bottom: .16rem; }
  .archive { padding: .9rem; }
}
