:root {
  color-scheme: light;
  --canvas: #fcfbfa;
  --surface: #f4f1ed;
  --surface-strong: #eae5de;
  --plate-bg: #f2f2f0;
  --ink: #24211e;
  --ink-soft: #3c3732;
  --muted: #6c6660;
  --accent: #7e5c4e;
  --accent-soft: #efe9e3;
  --hairline: #e6e0d9;
  --hairline-strong: #c9c0b6;
  --status-ok: #286147;
  --status-ok-bg: #ecf4f0;
  --status-warn: #875210;
  --status-warn-bg: #fbf3e5;
  --status-error: #a33030;
  --status-error-bg: #fbefef;
  --focus: #4f6d9a;
  --gutter: clamp(18px, 5vw, 60px);
  --font-brand:
    "Didot", "Bodoni 72", "Baskerville", "Hiragino Mincho ProN", "YuMincho",
    "Times New Roman", serif;
  --font-serif-ja:
    "Hiragino Mincho ProN", "YuMincho", "Baskerville", Georgia, serif;
  --font-sans:
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", -apple-system,
    BlinkMacSystemFont, "Yu Gothic", sans-serif;
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

html {
  background: var(--canvas);
}

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

body {
  min-height: 100svh;
  background: var(--canvas);
  color: var(--ink);
  padding-bottom: max(32px, env(safe-area-inset-bottom));
}

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

button,
a,
input,
select {
  touch-action: manipulation;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

a {
  color: inherit;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(252, 251, 250, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hairline);
  padding-top: env(safe-area-inset-top);
}

.bar,
main {
  max-width: 1120px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.bar {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 66px;
}

body.logged-out .bar {
  justify-content: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-brand);
  font-size: 27px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.08em;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.bar nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 999px;
}

.bar nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--muted);
  border-radius: 999px;
  transition:
    background-color 0.16s ease,
    color 0.16s ease;
}

.bar nav a:hover {
  color: var(--ink);
}

.bar nav a[aria-current="page"] {
  background: var(--canvas);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(36, 33, 30, 0.06);
}

.account-btn {
  margin-left: auto;
  min-height: 44px;
  padding: 0 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  white-space: nowrap;
  transition:
    background-color 0.16s ease,
    border-color 0.16s ease;
}

.account-btn:hover {
  background: var(--surface);
  border-color: var(--ink);
}

#account-label {
  max-width: 14ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.icon {
  flex: none;
  display: block;
}

/* Buttons */
.primary,
.outline,
.danger {
  min-height: 44px;
  padding: 10px 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--ink);
  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

.primary-lg {
  min-height: 52px;
  padding: 12px 28px;
  font-size: 15px;
}

.primary {
  background: var(--ink);
  color: #fcfbfa;
}

.primary:hover:not(:disabled) {
  background: var(--ink-soft);
}

.primary:active:not(:disabled),
.outline:active:not(:disabled),
.danger:active:not(:disabled) {
  transform: scale(0.99);
}

.outline {
  background: var(--canvas);
  color: var(--ink);
  border-color: var(--hairline-strong);
}

.outline:hover:not(:disabled) {
  background: var(--surface);
  border-color: var(--ink);
}

.danger {
  background: var(--status-error);
  border-color: var(--status-error);
  color: #ffffff;
}

.danger:hover:not(:disabled) {
  background: #872626;
  border-color: #872626;
}

.compact-cta {
  white-space: nowrap;
  font-size: 13px;
  padding: 8px 18px;
}

.text-action {
  min-height: 44px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  border-radius: 999px;
}

.text-action:hover:not(:disabled) {
  color: var(--ink);
  background: var(--surface);
}

.soft-link {
  min-height: 44px;
  padding: 8px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  text-decoration: none;
  transition: background-color 0.15s ease;
}

.soft-link:hover {
  background: var(--surface-strong);
}

.clear {
  min-height: 44px;
  padding: 8px 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  white-space: nowrap;
}

.clear:hover:not(:disabled) {
  border-color: var(--ink);
  background: var(--surface-strong);
}

/* Editorial Spread Grid (Login & Capture) */
.editorial-grid {
  display: grid;
  grid-template-columns: minmax(0, 440px) minmax(0, 1fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  padding: clamp(24px, 4.5vw, 52px) 0 clamp(32px, 5vw, 56px);
}

.login-grid {
  min-height: calc(100svh - 104px);
}

.editorial-copy {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.ja-editorial-title {
  font-family: var(--font-serif-ja);
  font-size: clamp(26px, 3vw, 38px);
  font-weight: 500;
  line-height: 1.42;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.stage-title {
  font-size: clamp(22px, 2.4vw, 30px);
}

.lead-body,
.stage-intro {
  font-size: 14px;
  line-height: 1.85;
  color: var(--muted);
  max-width: 34em;
  overflow-wrap: anywhere;
}

.cta-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-top: 8px;
}

.login-footnote {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}

/* Cover & Viewfinder Card */
.cover-card {
  min-width: 0;
}

.frame {
  background: var(--plate-bg);
  aspect-ratio: 4 / 5;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
}

.frame > * {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  filter: none;
}

.frame .cover {
  object-fit: cover;
  object-position: 50% 68%;
}

.stage-photo-btn {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  background: transparent;
}

.stage-photo-btn img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  filter: none;
  display: block;
}

.empty-stage {
  width: 100%;
  height: 100%;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  background: var(--surface);
  color: var(--muted);
}

.empty-stage-icon {
  color: var(--accent);
  opacity: 0.78;
}

.empty-stage-title {
  font-family: var(--font-serif-ja);
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.03em;
}

.empty-stage-sub {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 22em;
}

.plate-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 4px 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.plate-caption time {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

/* Capture Stage Controls */
.stage-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--hairline);
}

.phase-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.phase-badge[data-tone="live"] {
  background: var(--status-error-bg);
  color: var(--status-error);
  border-color: #f0d0d0;
}

.phase-badge[data-tone="live"]::before {
  background: var(--status-error);
}

.phase-badge[data-tone="sending"]::before {
  animation: pulse-dot 1s ease-in-out infinite;
}

.phase-badge[data-tone="pending"] {
  background: var(--status-warn-bg);
  color: var(--status-warn);
  border-color: #ecd9bc;
}

.phase-badge[data-tone="pending"]::before {
  background: var(--status-warn);
}

@keyframes pulse-dot {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 1;
  }
}

.target-pill {
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.primary-deck {
  margin-top: 4px;
}

.icon-retry {
  display: none;
}

.shutter-ring {
  display: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #fcfbfa;
  position: relative;
  flex: none;
}

.shutter-ring::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: 50%;
  background: #fcfbfa;
}

body.phase-live .icon-camera,
body.phase-pending .icon-camera {
  display: none;
}

body.phase-live .shutter-ring {
  display: inline-block;
}

body.phase-pending .icon-retry {
  display: block;
}

body.active-shot .site-header {
  position: static;
}

body.active-shot .stage-frame {
  background: #1a1817;
  border-color: #1a1817;
  aspect-ratio: 4 / 5;
}

/* Review & Tagging Card */
.review-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 18px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.filter-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  max-width: 100%;
}

.field-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.optional-mark {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.tag-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chips button {
  min-height: 44px;
  min-width: 58px;
  padding: 6px 15px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition:
    background-color 0.14s ease,
    color 0.14s ease,
    border-color 0.14s ease;
}

.tag-chips button:hover {
  border-color: var(--ink);
}

.tag-chips button[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: #fcfbfa;
}

.tag-chips button[aria-pressed="true"]::before {
  content: "✓";
  font-size: 12px;
  line-height: 1;
}

input[type="text"] {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 14px;
  font-size: 16px;
  line-height: 1.3;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 46px;
  background: var(--canvas);
  border: 1px solid var(--hairline-strong);
  border-radius: 12px;
  overflow: hidden;
}

.input-shell:focus-within {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}

.input-shell input[type="date"],
.input-shell select {
  -webkit-appearance: none;
  appearance: none;
  display: flex;
  align-items: center;
  flex: 1 1 0%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  min-height: 44px;
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 16px;
  line-height: normal;
  color: var(--ink);
  text-align: left;
  outline: none;
}

.input-shell input[type="date"] {
  justify-content: space-between;
  padding: 0 14px;
  font-variant-numeric: tabular-nums;
}

.input-shell input[type="date"]::-webkit-date-and-time-value {
  text-align: left;
  margin: 0;
  min-height: 1.3em;
  line-height: 1.3;
}

.input-shell select {
  display: block;
  padding: 0 38px 0 14px;
}

.select-chevron {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

input[type="text"]::placeholder {
  color: var(--muted);
}

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

.review-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 10px;
}

.secondary-deck {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* Status Notices */
.notice {
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.notice:empty {
  display: none;
}

.notice:not(:empty) {
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--ink);
}

.notice[data-tone="error"]:not(:empty) {
  border-color: #eed0d0;
  background: var(--status-error-bg);
  color: var(--status-error);
}

.notice[data-tone="ok"]:not(:empty) {
  border-color: #cbe3d6;
  background: var(--status-ok-bg);
  color: var(--status-ok);
}

.notice[data-tone="warn"]:not(:empty) {
  border-color: #eddac0;
  background: var(--status-warn-bg);
  color: var(--status-warn);
}

/* Timeline Section */
#timeline {
  padding: clamp(22px, 3.5vw, 40px) 0 56px;
}

.sectionhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sectionhead-titles {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 14px;
}

.section-title {
  font-size: clamp(24px, 2.8vw, 34px);
}

.count-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Filter Bar */
.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 210px) minmax(0, 230px) minmax(0, 1fr);
  gap: 14px 16px;
  align-items: end;
  margin: 20px 0 26px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
}

.filter-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.filter-status {
  font-size: 12px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

/* Empty & Loading Box */
.empty-box {
  padding: 44px 22px;
  text-align: center;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.empty-box p {
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 28em;
}

/* Timeline Lookbook Grid */
#records.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 28px 20px;
}

.look-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  font-size: 13px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.look-plate {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--plate-bg);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.look-plate-btn {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0;
  border-radius: 14px;
  overflow: hidden;
  background: transparent;
  transition: opacity 0.15s ease;
}

.look-plate-btn:hover {
  opacity: 0.94;
}

.look-plate-btn:active {
  opacity: 0.86;
}

.look-plate img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  display: block;
}

.look-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 2px 0;
}

.look-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.look-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.look-tag-chip {
  display: inline-block;
  padding: 2px 9px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ink-soft);
  background: var(--accent-soft);
  border-radius: 999px;
}

.look-weather {
  font-size: 12px;
  line-height: 1.55;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.look-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.look-status::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex: none;
}

.look-status[data-tone="ok"] {
  background: var(--status-ok-bg);
  color: var(--status-ok);
}

.look-status[data-tone="ok"]::before {
  background: var(--status-ok);
}

.look-status[data-tone="warn"] {
  background: var(--status-warn-bg);
  color: var(--status-warn);
}

.look-status[data-tone="warn"]::before {
  background: var(--status-warn);
}

.look-status[data-tone="error"] {
  background: var(--status-error-bg);
  color: var(--status-error);
}

.look-status[data-tone="error"]::before {
  background: var(--status-error);
}

.look-status[data-tone="neutral"] {
  background: var(--surface);
  color: var(--muted);
}

.look-status[data-tone="neutral"]::before {
  background: var(--muted);
}

.look-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 12px;
  align-items: center;
  margin-top: 6px;
  padding-top: 4px;
  border-top: 1px solid var(--hairline);
}

.look-card a,
.look-card button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 13px;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  color: var(--ink);
}

.look-card a.source-link {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
}

.look-card button.retry-btn {
  padding: 6px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  background: var(--canvas);
}

.look-card button.retry-btn:hover:not(:disabled) {
  background: var(--surface);
}

.look-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* Account Dialog */
dialog {
  width: min(400px, calc(100vw - 32px));
  max-width: 100%;
  border: 1px solid var(--hairline);
  border-radius: 20px;
  background: var(--canvas);
  color: var(--ink);
  padding: 24px;
  box-shadow: 0 20px 52px rgba(36, 33, 30, 0.16);
}

dialog::backdrop {
  background: rgba(36, 33, 30, 0.42);
}

.dialog-head h2 {
  font-family: var(--font-serif-ja);
  font-size: 19px;
  font-weight: 600;
}

.dialog-detail {
  margin: 14px 0 0;
  padding: 13px 14px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.dialog-warning {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--status-warn-bg);
  border: 1px solid #eddac0;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--status-warn);
}

.dialog-actions {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

/* Look Detail & Day Forecast Dialog */
.look-detail-dialog {
  width: min(920px, calc(100vw - 40px));
  max-width: 100%;
  max-height: min(90svh, 840px);
  padding: 0;
  overflow: hidden;
  border-radius: 20px;
  border: 1px solid var(--hairline);
  background: var(--canvas);
  color: var(--ink);
  box-shadow: 0 24px 64px rgba(36, 33, 30, 0.22);
}

.look-detail-dialog[open] {
  display: flex;
  flex-direction: column;
}

.detail-shell {
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 0;
  max-height: inherit;
  overflow: hidden;
}

.detail-bar {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 18px;
  background: rgba(252, 251, 250, 0.96);
  border-bottom: 1px solid var(--hairline);
}

.back-btn {
  min-height: 44px;
  padding: 0 12px 0 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  border-radius: 999px;
}

.back-btn:hover {
  background: var(--surface);
}

.detail-date-chip {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
}

.detail-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 28px;
  padding: 24px;
  align-items: start;
}

.detail-visual,
.detail-info {
  min-width: 0;
}

.detail-plate {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--plate-bg);
  border: 1px solid var(--hairline);
  border-radius: 16px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.detail-plate img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: none;
  display: block;
}

.detail-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.detail-meta-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.detail-heading {
  font-family: var(--font-serif-ja);
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.detail-actions a,
.detail-actions button {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.detail-actions button.retry-btn {
  padding: 6px 16px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
  background: var(--canvas);
}

.forecast-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: 16px;
}

.forecast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.forecast-heading {
  font-family: var(--font-serif-ja);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.02em;
}

.forecast-range {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
}

.forecast-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 10px 12px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  font-size: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.forecast-summary strong {
  font-weight: 600;
  color: var(--ink);
}

.forecast-bands,
.forecast-hourly-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.forecast-row {
  display: grid;
  grid-template-columns: minmax(0, 96px) minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 12px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
  font-variant-numeric: tabular-nums;
}

.forecast-row.is-captured {
  background: var(--accent-soft);
  border-color: var(--hairline-strong);
}

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

.forecast-period {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.captured-dot {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 999px;
  background: var(--ink);
  color: #fcfbfa;
}

.forecast-hour {
  font-size: 12px;
  color: var(--muted);
}

.forecast-cond {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.weather-icon {
  flex: none;
  color: var(--accent);
}

.forecast-metrics {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  white-space: nowrap;
}

.forecast-temp {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.forecast-precip {
  font-size: 12px;
  color: var(--muted);
}

.forecast-precip.has-rain {
  color: var(--focus);
  font-weight: 600;
}

.forecast-details {
  border-top: 1px solid var(--hairline);
  padding-top: 8px;
}

.forecast-details summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  cursor: pointer;
  list-style: none;
}

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

.forecast-details summary::after {
  content: "＋";
  font-size: 14px;
  color: var(--muted);
}

.forecast-details[open] summary::after {
  content: "－";
}

.forecast-hourly-list {
  margin-top: 8px;
}

.forecast-hourly-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.forecast-hourly-row.is-captured {
  background: var(--accent-soft);
  border-color: var(--hairline-strong);
}

.forecast-fallback {
  font-size: 13px;
  line-height: 1.75;
  color: var(--muted);
  padding: 10px 12px;
  background: var(--canvas);
  border: 1px solid var(--hairline);
  border-radius: 12px;
}

.forecast-source a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-size: 12px;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Mobile Layout (iPhone 320px - 680px) */
@media (max-width: 680px) {
  .bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 10px;
    min-height: 0;
    padding-top: 8px;
    padding-bottom: 10px;
  }

  body.logged-out .bar {
    display: flex;
    justify-content: center;
    padding-block: 8px;
  }

  .brand {
    font-size: 24px;
    grid-column: 1;
    grid-row: 1;
  }

  .account-btn {
    grid-column: 2;
    grid-row: 1;
    margin-left: 0;
    padding: 0 13px;
  }

  .bar nav {
    grid-row: 2;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    padding: 3px;
  }

  .bar nav a {
    min-height: 44px;
    width: 100%;
    padding: 0 8px;
    text-align: center;
    font-size: 14px;
  }

  .editorial-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 16px 0 28px;
  }

  .login-grid {
    min-height: 0;
  }

  .cover-frame {
    aspect-ratio: 4 / 5;
    max-height: 46svh;
    width: 100%;
  }

  .stage-frame {
    aspect-ratio: 4 / 5;
    max-height: 44svh;
    width: 100%;
  }

  .ja-editorial-title {
    font-size: clamp(24px, 6.8vw, 30px);
  }

  .cta-stack,
  .primary-deck {
    width: 100%;
  }

  .cta-stack .primary,
  .primary-deck .primary,
  .soft-link {
    width: 100%;
  }

  body.active-shot .stage-frame {
    aspect-ratio: auto;
    max-height: none;
    height: clamp(260px, 43svh, 400px);
  }

  .filter-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
    margin: 16px 0 20px;
  }

  .filter-footer {
    justify-content: space-between;
  }

  #records.grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }

  .look-detail-dialog {
    width: 100vw;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .detail-bar {
    padding-top: max(10px, env(safe-area-inset-top));
    padding-inline: 12px 16px;
  }

  .detail-body {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    padding: 16px var(--gutter) max(32px, env(safe-area-inset-bottom));
  }

  .detail-plate {
    max-height: 56svh;
  }
}

@media (max-width: 340px) {
  #records.grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .review-actions,
  .dialog-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .sectionhead {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
