* { box-sizing: border-box; }
:root {
  color-scheme: light;
  --paper: #f6f5ef;
  --panel: #fffdf8;
  --ink: #1c2723;
  --muted: #58665d;
  --line: #e1e4d9;
  --accent: #205747;
  --accent-soft: #e6f0e9;
  --review: #85531b;
  --review-soft: #f8eddb;
}
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.65 "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
}
.workspace { width: min(1220px, calc(100% - 52px)); margin: 36px auto 64px; }
.heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(25px, 4vw, 38px); line-height: 1.25; }
h2 { font-size: 19px; line-height: 1.4; }
h3 { font-size: 16px; overflow-wrap: anywhere; }
.product { color: var(--accent); font-weight: 700; margin-bottom: 6px; }
.connection, .help, #progress, .style-name { color: var(--muted); font-size: 13px; }
.layout { display: grid; grid-template-columns: 275px minmax(0, 1fr); align-items: start; gap: 18px; }
.layout[data-view=unregistered] { grid-template-columns: minmax(0, 1fr); }
.layout[data-view=unregistered] .outside-preparation,
.layout:not([data-view=unregistered]) .preparation-only { display: none; }
.step-title { display: flex; align-items: baseline; gap: 8px; }
.step-number { flex: none; color: var(--accent); }
.photo-entry { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 26px; margin-top: 12px; }
.photo-entry h3 { margin-bottom: 8px; }
.photo-entry .photo-drop { margin-top: 0; }
.photo-drop + .help, .destination-picker > .help { margin-top: 5px; }
.workspace-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.store-settings { display: grid; gap: 14px; width: min(600px, 100%); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 20px; }
.sign-in { max-width: 520px; margin: 7vh auto 0; }
.sign-in .panel { display: grid; gap: 16px; margin-top: 24px; }
.sign-in button { justify-self: start; }
.account-bar { display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-bottom: 20px; }
.add-store summary { font-weight: 650; cursor: pointer; }
.add-store form { display: grid; gap: 7px; margin-top: 10px; }
.add-store form button { justify-self: start; }
#store-status:empty { display: none; }
#destinations { display: grid; gap: 7px; margin-top: 8px; }
.layout[data-view=unregistered] #destinations { grid-template-columns: repeat(auto-fit, minmax(min(266px, 100%), 1fr)); }
#destinations label { display: flex; min-width: 0; align-items: start; gap: 5px; overflow-wrap: anywhere; }
.store-progress { display: grid; gap: 3px; list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; }
.store-progress li { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; padding: 3px 6px; background: #f5f6ef; border-radius: 4px; }
.style-applied-options { overflow-wrap: anywhere; }
.style-pending-options { color: var(--review); font-weight: 650; }
.store-readiness-note { flex-basis: 100%; color: var(--review); font-size: 12px; overflow-wrap: anywhere; }
#registration-progress:empty { display: none; }
#settings label, .folder { display: grid; gap: 5px; margin-top: 13px; font-weight: 650; }
#settings-connection { margin-top: 8px; justify-content: space-between; }
.settings-login { color: var(--accent); font-size: 13px; font-weight: 650; }
#web-login-help { margin-top: 7px; }
.settings-update { margin-top: 12px; }
#settings-sync-progress { margin-top: 12px; padding: 9px 10px; background: var(--accent-soft); border-radius: 7px; font-size: 13px; }
#settings-sync-progress .actions { margin-top: 4px; }
#settings-sync-result:not(:empty) { margin-top: 8px; }
.settings-catalog { margin-top: 14px; }
.settings-catalog-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 7px 14px; border-top: 1px solid var(--line); padding: 11px 0; }
#apply-store-options { white-space: normal; margin-top: 6px; }
#registration-option-fields { min-width: 0; display: grid; gap: 8px; border: 0; padding: 6px 0 10px; margin: 0; }
#registration-option-fields fieldset { min-width: 0; border: 1px solid var(--line); border-radius: 6px; padding: 4px 8px 8px; margin: 0; }
#registration-option-fields legend { padding: 0 4px; font-weight: 650; font-size: 13px; }
.option-fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; }
.option-fields label { min-width: 0; display: grid; gap: 3px; font-size: 13px; }
#registration-options .help { margin-top: 6px; }
#apply-options-status:empty { display: none; }
#registration-options-summary { font-weight: 650; }
#registration-options-summary[data-pending=true] { color: var(--review); }
#export { white-space: normal; overflow-wrap: anywhere; }
#other-registration-actions summary { color: var(--accent); cursor: pointer; font-weight: 650; padding: 6px 0; }
#other-registration-actions .actions { margin: 3px 0; }
.folder { padding: 12px; border: 1px dashed #a8b7af; border-radius: 8px; background: #f4f8f2; }
.folder + .help { margin-top: 9px; }
.photo-drop { display: grid; justify-items: center; gap: 8px; margin-top: 14px; padding: 14px 8px; border: 1px dashed #7e9687; border-radius: 8px; background: #f4f8f2; text-align: center; }
.photo-drop.dragging, .photo-slot.dragging { background: #deebdd; border-color: #49785a; }
#add-style { margin-top: 6px; }
#photo-composer-status:not(:empty), #web-focus, #web-resume, #web-resume-message:not(:empty) { margin-top: 6px; }
input, select, button, textarea { font: inherit; }
input[type=text], input:not([type]), select, textarea {
  width: 100%;
  background: white;
  color: var(--ink);
  border: 1px solid #b6c2b9;
  border-radius: 7px;
  padding: 8px 9px;
}
input[type=file] { width: 100%; font-size: 12px; font-weight: 450; }
input[type=checkbox] { accent-color: var(--accent); }
button {
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  padding: 7px 12px;
  font-weight: 650;
  white-space: nowrap;
}
button.secondary { background: transparent; color: var(--accent); }
button.remove-style { border-color: #b88d85; color: #8a4135; }
button.remove-style:hover:not(:disabled) { background: #f8ece7; }
button:disabled { opacity: .48; cursor: default; }
:focus-visible { outline: 2px solid #457861; outline-offset: 3px; }
.worklist-heading, .actions, .filters, .card-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.worklist-heading, .card-heading { justify-content: space-between; }
.worklist-heading + .help { margin-top: 7px; }
#destination { overflow-wrap: anywhere; }
.style-views { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
.style-views button { border-color: var(--line); }
:is(.style-views, .workspace-nav) button[aria-pressed=true] { color: white; background: var(--accent); border-color: var(--accent); }
.style-views span { margin-left: 3px; font-variant-numeric: tabular-nums; }
.filters, .style-name { font-size: 13px; }
#progress { min-height: 22px; }
.registration-review { background: #f0f6ed; border: 1px solid #9fbaa4; border-radius: 8px; padding: 14px; margin-top: 12px; overflow-wrap: anywhere; }
.registration-review ul { margin: 6px 0; padding-left: 20px; }
#web-review-destinations { font-weight: 650; }
#web-review-total { font-size: 17px; font-weight: 700; margin-top: 4px; }
#web-review-held { margin-top: 10px; padding: 8px 12px; border-radius: 6px; background: var(--review-soft); color: var(--review); }
#web-review-held-title { margin: 0; font-size: 14px; }
.registration-review .actions { margin-top: 10px; }
.handoff { background: #f0f6ed; border: 1px solid #ccddcd; border-radius: 8px; padding: 12px; margin-top: 10px; }
.handoff .actions { margin: 4px 0; }
.handoff input { width: min(320px, 100%); font-family: ui-monospace, monospace; }
.filters { margin: 12px 0 1px; gap: 18px; }
.empty { border: 1px dashed #c7d1c5; border-radius: 10px; text-align: center; padding: 34px 12px; color: var(--muted); margin: 15px 0; }
.card { display: grid; gap: 10px; border-top: 1px solid var(--line); padding: 14px 0; }
.card:has(> input[type="checkbox"]) { grid-template-columns: auto minmax(0, 1fr); }
.card:first-child { margin-top: 10px; }
.card-body { min-width: 0; }
.card .status { border-radius: 999px; padding: 2px 8px; background: #f0f1eb; color: var(--muted); font-size: 12px; white-space: nowrap; }
.card .status.complete { color: var(--accent); background: var(--accent-soft); }
.card .status.review { color: var(--review); background: var(--review-soft); }
.card .description, .card .style-name { overflow-wrap: anywhere; margin-top: 4px; }
.card .tags { color: var(--accent); }
#style-editor { width: min(640px, calc(100% - 24px)); max-height: calc(100dvh - 24px); padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); color: var(--ink); }
#style-editor::backdrop { background: #1c272373; }
#style-editor label { display: grid; gap: 3px; margin-top: 10px; font-weight: 650; }
#style-editor fieldset { min-width: 0; margin: 12px 0 0; padding: 3px 12px 12px; border: 1px solid var(--line); border-radius: 8px; }
#style-editor legend { font-size: 14px; font-weight: 650; }
#style-editor :is(.actions, #style-editor-note, #style-editor-error:not(:empty)) { margin-top: 10px; }
#style-editor-error { color: var(--review); }
.photos { display: flex; flex-wrap: wrap; gap: 5px; margin: 7px 0; }
.photos figure { margin: 0; }
.photos img { display: block; width: 73px; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: #ebece3; }
.photos figcaption { font-size: 11px; font-weight: 650; color: var(--muted); text-align: center; }
.photos .photo-slot { position: relative; display: grid; place-items: center; width: 73px; aspect-ratio: 1; padding: 0; border: 1px dashed #7e9687; background: transparent; font-size: 11px; }
.photos .photo-slot img { width: 100%; pointer-events: none; }
.photos .photo-slot.dragging { background: #deebdd; border: 2px solid #49785a; }
.photos .photo-slot.dragging img { opacity: .45; }
.photo-entry .composer { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0 0 7px; }
.composer .photo-slot { width: 100%; height: clamp(78px, 13vw, 154px); aspect-ratio: auto; overflow: hidden; background: #f4f8f2; }
.composer .photo-slot img { height: 100%; aspect-ratio: auto; object-fit: contain; background: transparent; }
.composer figcaption { margin-top: 3px; font-size: 12px; }
@media (max-width: 780px) {
  .workspace { width: calc(100% - 24px); margin-top: 24px; }
  .layout, .photo-entry { grid-template-columns: minmax(0, 1fr); }
  .panel { padding: 15px; }
}
