:root {
  color: #202e2b;
  background: #fffaf0;
  font: 16px/1.5 system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --muted: #51605b;
  --line: #d7ded8;
  --green: #245b48;
  --pale: #eaf2eb;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { scroll-margin-top: 90px; }
.shell { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
a { color: var(--green); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid #215bb0; outline-offset: 3px; }
.skip-link { position: fixed; z-index: 200; top: 10px; left: 12px; padding: 10px 14px; border-radius: 7px; background: white; }
.skip-link:not(:focus) { clip-path: inset(50%); }

h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.18; letter-spacing: -.028em; }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
.intro { display: grid; justify-items: start; gap: 10px; padding: 29px 0 24px; }
.intro p { color: var(--muted); }
.breadcrumb { display: flex; gap: 9px; align-items: center; font-size: .85rem; }
.breadcrumb a { font-weight: 650; }

.work { background: white; border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 8px 32px #273b2b08; }
.privacy { padding: 13px clamp(14px, 3vw, 27px); background: var(--pale); border-radius: 17px 17px 0 0; font-size: .9rem; color: #294b3a; }
.album-bar { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 13px; padding: clamp(14px, 3vw, 23px) clamp(14px, 3vw, 27px); border-bottom: 1px dashed #adbdb2; }
.album-bar.is-dropping { background: #dbefdd; outline: 2px dashed var(--green); outline-offset: -4px; }
#album-info { margin-top: 5px; color: var(--muted); font-size: .9rem; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
button, select { min-height: 42px; font: inherit; color: inherit; }
button { padding: 8px 12px; background: #fff; border: 1px solid #9dab9f; border-radius: 8px; font-size: .875rem; font-weight: 650; cursor: pointer; }
button.primary { color: white; background: var(--green); border-color: var(--green); }
button[aria-pressed="true"] { background: var(--pale); border-color: var(--green); color: #194433; }
button:disabled { opacity: .56; cursor: default; }
input[type="radio"], input[type="range"] { accent-color: var(--green); }
select { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid #9dab9f; border-radius: 8px; background: #fff; font-size: .9rem; text-overflow: ellipsis; }
.status { color: var(--green); font-size: .9rem; font-weight: 600; }
#status:not(:empty) { padding: 9px clamp(14px, 3vw, 27px) 0; }
.import-errors { padding: 8px clamp(20px, 3vw, 34px); margin: 0 0 0 20px; color: #7b3b27; font-size: .875rem; overflow-wrap: anywhere; }

.empty { margin: clamp(14px, 3vw, 27px); display: grid; justify-items: center; gap: 12px; text-align: center; padding: 38px 16px; border: 1px solid var(--line); border-radius: 12px; background: #f7f8f4; }
.empty p { color: var(--muted); max-width: 29rem; }
.empty-art { position: relative; width: 184px; height: 105px; margin-bottom: 8px; }
.empty-art span { position: absolute; inset-block: 6px; width: 75px; border: 5px solid #fff; border-radius: 8px; box-shadow: 0 0 0 1px #acb7ad, 0 4px 10px #293b3320; }
.empty-art span:nth-child(1) { left: 7px; transform: rotate(-14deg); background: linear-gradient(150deg, #efe8d6 52%, #b6c4ae 53%); }
.empty-art span:nth-child(2) { right: 7px; transform: rotate(14deg); background: linear-gradient(150deg, #d6e2e4 45%, #9eb5ac 46%); }
.empty-art span:nth-child(3) { left: 52px; background: radial-gradient(circle at 69% 25%, #fff0c2 10%, transparent 11%), linear-gradient(157deg, transparent 63%, #4e7b67 64%), linear-gradient(202deg, #cdded1 43%, #7e9f84 44%); }

.workspace { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; gap: clamp(14px, 3vw, 25px); padding: clamp(14px, 3vw, 27px); }
.preview-panel { min-width: 0; border: 1px solid var(--line); border-radius: 13px; background: #f5f6f1; overflow: hidden; scroll-margin-top: 90px; }
.view-modes { display: flex; align-items: stretch; gap: 6px; flex-wrap: wrap; padding: 12px; border-bottom: 1px solid var(--line); background: #fff; }
.view-modes button { flex: 1 1 auto; }
.view { padding: clamp(10px, 2vw, 18px); }
.comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: clamp(8px, 2vw, 17px); }
.candidate { min-width: 0; display: grid; gap: 8px; }
.candidate label { font-size: .9rem; font-weight: 700; }
.photo-canvas { display: block; width: 100%; height: auto; border-radius: 8px; background: #fff; }
#edit-view { max-width: 482px; margin: auto; }
#edit-photo { cursor: grab; touch-action: none; }
#edit-photo:active { cursor: grabbing; }
.crop-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 10px; margin-bottom: 10px; }
.crop-heading span { color: var(--muted); font-size: .85rem; }
.crop-controls { display: grid; grid-template-columns: auto minmax(65px, 1fr) auto; align-items: center; gap: 10px; margin-block: 12px 8px; }
.crop-controls label { font-size: .85rem; }
.crop-controls output { font-weight: 700; }
.crop-controls input { width: 100%; min-height: 34px; margin: 0; }
.crop-controls button { padding-inline: 8px; }
.profile-preview { max-width: 320px; width: 100%; margin: 0 auto 10px; padding: 10px; border: 1px solid #c3cec5; background: #fff; border-radius: 15px; }
.profile-header, .profile-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.profile-header { padding: 2px 2px 8px; }
.profile-header span { font-size: .85rem; color: var(--muted); }
.profile-nav { padding-top: 10px; }
.profile-nav button { flex: 1; }
#preview-view > .note { text-align: center; }

.controls-panel { min-width: 0; }
.shape { min-width: 0; display: flex; flex-wrap: wrap; gap: 6px 9px; margin: 0; padding: 6px 0 12px; border: 0; }
.shape legend { font-weight: 700; }
.shape label { min-height: 42px; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; cursor: pointer; font-size: .875rem; }
.shape label:has(:checked) { border-color: var(--green); background: var(--pale); }
.shape input { margin: 0; }
.ordering { margin-top: 5px; }
.note { color: var(--muted); font-size: .875rem; }
.ordering > .note { margin-block: 5px 10px; }
#photo-list { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.photo-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; align-items: center; }
.photo-row[draggable="true"] { cursor: grab; }
.pick-photo { display: flex; width: 100%; align-items: center; gap: 7px; border-color: transparent; text-align: start; padding: 3px; min-width: 0; }
.row-thumbnail { display: block; flex: 0 0 34px; width: 34px; height: auto; border-radius: 4px; }
.row-name { display: grid; min-width: 0; }
.row-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .8rem; color: var(--muted); font-weight: 500; }
.row-actions { display: flex; gap: 3px; }
.row-actions button { width: 42px; padding-inline: 0; font-size: 1.1rem; }
.downloads { display: grid; gap: 6px; margin-top: 15px; padding-top: 13px; border-top: 1px solid var(--line); }
.downloads .actions { margin-top: 3px; }
#soft-warning { color: #775021; }

.details { max-width: 720px; display: grid; gap: 8px; padding-block: 33px 40px; }
.details h2 { margin-bottom: 4px; }
.details details { padding: 8px 0; border-bottom: 1px solid var(--line); }
.details summary { font-weight: 650; cursor: pointer; }
.details p { margin-top: 7px; color: var(--muted); }

@media (hover: hover) and (pointer: fine) {
  button:enabled:hover { border-color: var(--green); background: #f0f4ef; }
  button.primary:enabled:hover { background: #194937; }
}

@media (max-width: 790px) {
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .intro { padding-top: 22px; }
  .comparison { max-width: 540px; margin-inline: auto; }
}

@media (max-width: 510px) {
  .shell { width: calc(100% - 26px); }
  .workspace { padding: 10px; }
  .view-modes { padding: 7px; }
  .view-modes button { flex: 1 1 30%; min-width: 0; padding: 5px; font-size: .79rem; line-height: 1.22; }
  .album-bar { gap: 11px; }
  .crop-controls { gap: 6px; }
  .row-actions button { width: 44px; }
  button, select { min-height: 44px; }
}
