:root {
  color-scheme: light;
  --ink: #20211f;
  --muted: #63625d;
  --line: #d9d8d1;
  --paper: #faf9f5;
  --white: #fff;
  --rose: #d8a0ab;
  --focus: #845477;
  font-family: Inter,"Segoe UI","Microsoft YaHei",sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-size: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

[hidden] {
  display: none!important;
}

button,input,select,textarea {
  font: inherit;
  color: inherit;
}

button,a,input,select,textarea {
  touch-action: manipulation;
}

button,.button {
  cursor: pointer;
}

a {
  color: inherit;
}

button:disabled {
  cursor: default;
  opacity: .45;
}

button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.sr,.skip:not(:focus) {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip:focus {
  position: absolute;
  z-index: 3;
  padding: 12px;
  background: #fff;
}

.bar,.action-bar,.side-title,.actions,.account,.dialog-actions,.section-header,.version-selector,.asset-tools,.order-actions,.placement,.heading-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.bar {
  padding: 15px clamp(17px,3.5vw,66px);
  min-height: 77px;
  background: var(--ink);
  color: white;
}

.brand {
  font: 900 22px/.79 Arial,sans-serif;
  letter-spacing: -.1em;
  text-decoration: none;
  margin-right: 15px;
}

.brand span {
  display: block;
}

.bar h1 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .045em;
  margin: 0;
}

.admin-modes { display:flex; gap:clamp(12px,2vw,28px); }
.admin-modes button {
  border:0; border-bottom:2px solid transparent; background:transparent; color:#bebeb9;
  padding:8px 0 5px; white-space:nowrap; font-size:1rem; font-weight:600;
}
.admin-modes button[aria-pressed=true] { color:#fff; border-bottom-color:currentColor; }
.admin-modes button:hover { color:#fff; }
.admin-modes button[data-dirty=true]::after {
  content:""; display:inline-block; width:5px; height:5px; border-radius:50%;
  margin-left:4px; background:var(--rose); vertical-align:super;
}
.studio-sidebar nav { margin-top:18px; }
#studio-pane { margin-top:26px; }
#studio-editor { scroll-margin-top:88px; }
.studio-entry { padding-block:18px; border-top:1px solid var(--line); }
.studio-entry h4 { font-size:.92rem; font-weight:600; margin:0; }
.studio-entry .section-header { margin-bottom:12px; }
.studio-language { display:grid; gap:8px; width:fit-content; margin-top:26px; font-size:.82rem; }
.studio-language > div { display:flex; padding:3px; border:1px solid var(--line); border-radius:5px; background:white; }
.studio-language button { padding:5px 11px; border:0; border-radius:3px; background:transparent; color:var(--muted); }
.studio-language button[aria-pressed=true] { background:var(--ink); color:white; }
.studio-canvas-section { margin-bottom:clamp(30px,4vw,64px); scroll-margin-top:88px; }
.studio-section-heading { border-top:1px solid var(--ink); padding:15px 0 18px; }
.studio-section-heading h3 { width:fit-content; margin:0; font-size:1.05rem; }
.studio-section-heading h3:focus { outline:none; }
.studio-section-heading h3:focus-visible { outline:2px solid var(--focus); outline-offset:3px; }
.studio-canvas-section[data-studio-anchor=intro] .field { display:block; font-size:0; }
.studio-canvas-section[data-studio-anchor=intro] .field textarea { font-size:clamp(1rem,1.4vw,1.22rem); }
.studio-layout-card { min-width:0; margin:0 0 20px; }
.studio-layout-card + .studio-layout-card { padding-top:8px; border-top:1px solid var(--line); }
.studio-card-actions { display:flex; gap:8px; align-items:center; justify-content:flex-end; flex-wrap:wrap; }
.studio-card-tools { margin:0 0 10px; }
.studio-card-tools .mini { min-width:auto; padding:3px 8px; }
.studio-card-tools .text-button { padding:3px 0; }
.studio-image-copy { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(0,1fr); align-items:start; gap:clamp(14px,2vw,32px); }
.studio-picture { min-width:0; }
.studio-picture-picker { position:relative; display:grid; align-items:end; justify-items:end; width:100%; background:var(--paper); cursor:pointer; }
.studio-picture-picker img { display:block; width:100%; height:auto; grid-area:1/1; }
.studio-picture-picker.is-empty { min-height:120px; aspect-ratio:2.12; place-items:center; border:1px dashed #aaa99d; }
.studio-picture-picker input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.studio-picture-picker:focus-within { outline:2px solid var(--focus); outline-offset:3px; }
.studio-pick-label { grid-area:1/1; z-index:1; pointer-events:none; margin:10px; padding:6px 12px; border:1px solid #b9b9b0;
  border-radius:3px; color:var(--ink); background:white; font-size:.8rem; font-weight:550; }
.studio-picture > .field { margin-top:10px; }
.studio-alt { margin-top:8px; font-size:.8rem; color:var(--muted); }
.studio-alt summary { width:fit-content; cursor:pointer; }
.studio-alt .field { margin-top:8px; color:var(--ink); }
.studio-story-fields { display:grid; gap:13px; justify-items:start; }
.studio-story-fields > .field,.studio-paragraph { width:100%; min-width:0; }
.studio-paragraph .text-button { font-size:.75rem; color:var(--muted); }
.studio-gallery-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); align-items:start; gap:clamp(14px,2vw,32px); }
.studio-gallery-grid .studio-layout-card + .studio-layout-card { padding-top:0; border-top:0; }
.studio-person-photo {
  display:grid; grid-template-columns:120px minmax(0, 1fr); align-items:start;
  gap:16px; margin-bottom:16px;
}
.portrait-frame {
  position:relative; display:grid; place-items:center; width:100%; aspect-ratio:4/5; overflow:hidden;
  background:var(--paper); color:var(--muted); font-size:.75rem;
}
.portrait-frame img { position:absolute; inset:0; display:block; width:100%; height:100%; object-fit:cover; }
.portrait-tools { max-width:360px; min-width:0; }
.portrait-tools input[type=file] { max-width:100%; }
.portrait-tools details { margin-top:7px; }
.portrait-tools summary { width:fit-content; font-size:.84rem; cursor:pointer; }
.studio-sliders { display:grid; gap:6px; margin-top:10px; }
.studio-sliders label { display:grid; align-items:center; grid-template-columns:5em minmax(32px,1fr) 3.3em; gap:6px; font-size:.78rem; }
.studio-sliders input { width:100%; margin:0; accent-color:var(--ink); }
.studio-sliders output { text-align:right; font-variant-numeric:tabular-nums; }
@media(max-width:640px) {
  .studio-person-photo { grid-template-columns:82px minmax(0,1fr); gap:10px; }
}
@media(max-width:960px) {
  .studio-image-copy { grid-template-columns:minmax(0,1.1fr) minmax(0,1fr); gap:14px; }
}
@media(max-width:740px) {
  .studio-image-copy,.studio-gallery-grid { grid-template-columns:minmax(0,1fr); }
  .studio-language { margin-top:12px; }
  .studio-canvas-section { scroll-margin-top:100px; }
}
.studio-year { max-width:11rem; margin-bottom:16px; }
#contact-editor { max-width: 1040px; margin-inline:auto; border:0; }
#contact-pane { margin-top: 24px; }
.contact-editor-row { border:0; border-top:1px solid var(--line); margin:0 0 18px; padding:18px 0 0; min-width:0; }
.contact-editor-row h3 { margin:0; font-size:1rem; }
.contact-editor-row .field-grid { margin-block:12px; }
.contact-editor-row .section-header { margin-bottom:12px; }
#project-list .list-item { display:grid; grid-template-columns:clamp(54px,5.6vw,84px) minmax(0,1fr); align-items:center; gap:12px; }
.project-thumb { display:grid; place-items:center; aspect-ratio:16/9; overflow:hidden; background:#e4e2dc; color:var(--muted); font-size:.68rem; }
.project-thumb img { grid-area:1/1; width:100%; height:100%; object-fit:cover; display:block; }
.project-list-copy { min-width:0; overflow-wrap:anywhere; }
@media(max-width:640px) {
  .admin-modes { gap:12px; }
  .admin-modes button { font-size:.86rem; }
  .bar:has(.admin-modes:not([hidden])) { flex-wrap:wrap; }
  .studio-sidebar nav { display:flex; flex-wrap:wrap; gap:4px; max-height:none; }
  .studio-sidebar .list-item { width:auto; font-size:.8rem; }
}

.account {
  margin-left: auto;
  font-size: .84rem;
  min-width: 0;
}

.account span {
  overflow-wrap: anywhere;
}

.account button {
  white-space: nowrap;
  border: none;
  background: transparent;
  color: inherit;
  padding: 9px 0 9px 5px;
  text-decoration: underline;
  text-underline-offset: .2em;
}

.action-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  min-height: 70px;
  padding: 10px clamp(17px,3.5vw,66px);
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--white);
}

.action-bar #status {
  font-size: .84rem;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.action-bar [data-tone=error],.form-error {
  color: #942f38;
}

.action-bar [data-tone=dirty] {
  color: #765522;
}

.button,.text-button,.tabs button,.list-item,.mini,.version-btn {
  border: 0;
  background: transparent;
  text-align: inherit;
}

.button,.mini,.version-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  line-height: 1.3;
}

.button {
  padding: 9px 13px;
  border: 1px solid #b9b9b0;
  border-radius: 4px;
  font-size: .86rem;
  font-weight: 550;
  white-space: nowrap;
}

.button.primary {
  border-color: var(--ink);
  background: var(--ink);
  color: white;
}

.button:not(:disabled):hover,.mini:not(:disabled):hover,.version-btn:hover {
  background: #e9e8e2;
}

.button.primary:not(:disabled):hover {
  background: #484941;
}

.text-button {
  padding: 5px 0;
  font-size: .84rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.danger {
  color: #942f38;
}

.mini {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 6px 10px;
  min-width: 34px;
  font-size: .82rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(225px,26%) minmax(0,1fr);
  max-width: 1660px;
  margin: auto;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 70px;
  padding: 26px clamp(16px,2vw,32px) 40px clamp(17px,3.5vw,58px);
  height: calc(100vh - 12px);
  max-height: calc(100dvh - 70px);
  overflow: auto;
}

.side-title,.section-header,.heading-row {
  justify-content: space-between;
}

.side-title h2 {
  font-size: 1.1rem;
  margin: 0;
}

.side-title h2 span {
  color: var(--muted);
  font-size: .8rem;
}

.search {
  display: block;
  margin-top: 18px;
}

.search input,.field input,.field select,.field textarea,.filter select,.asset-tools select {
  border: 1px solid #c5c5bb;
  border-radius: 3px;
  background: var(--white);
  padding: 9px 10px;
  min-height: 39px;
  min-width: 0;
  width: 100%;
}

.filter {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .82rem;
  color: var(--muted);
  margin: 9px 0 17px;
}

.filter select {
  flex: 1;
  min-height: 34px;
  padding: 4px 7px;
}

.list-item {
  display: block;
  width: 100%;
  padding: 10px 10px 10px 12px;
  border-left: 3px solid transparent;
}

.list-item strong,.list-item small {
  display: block;
  overflow-wrap: anywhere;
}

.list-item strong {
  font-size: .9rem;
  font-weight: 550;
}

.list-item small {
  font-size: .74rem;
  color: var(--muted);
  margin-top: 3px;
}

.list-item[aria-current=true] {
  border-color: var(--ink);
  background: #eae9e2;
}

.list-item:hover {
  background: #efeee8;
}

.editor {
  min-height: calc(100vh - 148px);
  padding: clamp(24px,3vw,55px) clamp(18px,3.5vw,64px) 80px;
  border-left: 1px solid var(--line);
  background: #fff;
  min-width: 0;
}

.project-heading {
  font-size: clamp(1.65rem,3.1vw,3.15rem);
  font-weight: 530;
  line-height: 1.13;
  letter-spacing: -.055em;
  margin: 0;
  overflow-wrap: anywhere;
}

.heading-row {
  align-items: flex-start;
}

.heading-row .text-button {
  flex-shrink: 0;
}

.meta,.hint,.empty,.asset-path,.section-note {
  font-size: .82rem;
  line-height: 1.6;
  color: var(--muted);
}

.meta {
  margin: 8px 0 0;
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  gap: clamp(14px,2.7vw,40px);
  border-bottom: 1px solid var(--line);
  margin: 23px 0;
}

.tabs button {
  padding: 10px 0 9px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: .9rem;
}

.tabs button[aria-pressed=true] {
  border-color: var(--ink);
  color: var(--ink);
  font-weight: 650;
}

.field-grid,.media-grid {
  display: grid;
  grid-template-columns: repeat(2,minmax(0,1fr));
  gap: 17px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
  font-weight: 550;
  font-size: .85rem;
}

.field input,.field select,.field textarea {
  font-weight: 400;
  font-size: .93rem;
}

.field textarea {
  line-height: 1.5;
  resize: vertical;
  min-height: 84px;
}

.field-grid+.field-grid,.field-grid+.section-note,.form-section+.form-section {
  margin-top: 22px;
}

.field-grid .span-all {
  grid-column: 1/-1;
}

.form-section {
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.form-section h3,.section-header h3,.media-box h4 {
  font-size: 1rem;
  margin: 0;
}

.form-section>h3,.section-header {
  margin-bottom: 14px;
}

.section-note,.hint {
  margin: 6px 0 11px;
}

.version-selector {
  flex-wrap: wrap;
  margin: 0 0 18px;
}

.version-btn {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: .82rem;
}

.version-btn[aria-pressed=true] {
  color: white;
  background: var(--ink);
  border-color: var(--ink);
}

.media-box {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 13px;
  min-width: 0;
}

.media-box h4 {
  margin: 0 0 6px;
}

.asset-frame {
  display: block;
  background: #efeee9;
  aspect-ratio: 16/9;
  max-height: 164px;
  object-fit: contain;
  width: 100%;
  margin: 8px 0;
}

.asset-path {
  display: block;
  overflow-wrap: anywhere;
  margin: 5px 0 7px;
}

.asset-tools {
  flex-wrap: wrap;
  gap: 7px;
}

.asset-tools input[type=file] {
  max-width: 100%;
  font-size: .77rem;
}

.asset-tools input::file-selector-button {
  border: 1px solid #b9b9b0;
  background: #fff;
  border-radius: 3px;
  padding: 5px 8px;
  margin-right: 5px;
}

.media-box .field {
  margin-top: 10px;
  font-size: .78rem;
}

.media-box .field textarea {
  min-height: 55px;
}

.reuse {
  margin-top: 12px;
}
.supplemental-media { margin-top: 24px; }

.reuse summary {
  font-size: .84rem;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.reuse .asset-tools {
  margin-top: 10px;
}

.placement {
  flex-wrap: wrap;
  background: var(--paper);
  padding: 12px;
  border: 1px solid var(--line);
  font-size: .85rem;
}

.placement label {
  display: flex;
  align-items: center;
  gap: 9px;
}

.placement input {
  width: 17px;
  height: 17px;
  accent-color: var(--ink);
}

.order-actions {
  flex-shrink: 0;
  gap: 4px;
}

#editor,.home-panel {
  scroll-margin-top: 82px;
}

.home-panel {
  grid-column: 2;
  min-width: 0;
  background: var(--white);
  border: 1px solid var(--line);
}

.home-panel-header {
  padding: 22px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.home-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 14px;
  padding: 3px;
  border-radius: 4px;
  background: #efeee9;
}

.home-filters button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 3px;
  padding: 7px 4px;
  color: var(--muted);
  font-size: .84rem;
}

.home-filters button[aria-pressed=true] {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
  font-weight: 600;
}

.home-filters span,.home-group h3 span {
  margin-left: 2px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.home-changes {
  color: #754820;
  font-size: .75rem;
  overflow-wrap: anywhere;
  margin: 0;
}

.home-changes:not(:empty) {
  margin-top: 10px;
}

.home-panel-list {
  min-height: 0;
  padding: 0 12px 18px;
}

.home-group h3 {
  margin: 19px 4px 6px;
  font-size: .84rem;
}

.home-group h3 span {
  font-weight: 400;
}

.home-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.home-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  border-bottom: 1px solid var(--line);
}

.home-row[data-current=true] {
  background: #efeee9;
  box-shadow: inset 2px 0 var(--ink);
}

.home-item {
  flex: 1;
  display: grid;
  grid-template-columns: 34px minmax(0,1fr);
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  min-width: 0;
  padding: 5px 0;
  text-align: left;
}

.home-item:hover strong {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.home-thumb {
  display: block;
  height: 28px;
  background: #e7e5de;
}

.home-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.home-row strong,.home-row small {
  display: block;
  overflow-wrap: anywhere;
}

.home-row strong {
  font-size: .83rem;
  font-weight: 550;
}

.home-row small,.order-no {
  font-size: .75rem;
  color: var(--muted);
}

.order-no {
  min-width: 14px;
  text-align: center;
}

.home-pending {
  display: inline-block;
  color: #754820;
  font-size: .72rem;
  margin-top: 3px;
}

.home-row .mini {
  width: auto;
  min-width: 27px;
  padding: 4px 5px;
}

.home-row .home-membership {
  font-size: .76rem;
  white-space: nowrap;
}

@media(min-width:1120px) {
  #work-workspace {
    max-width: 1900px;
    grid-template-columns: clamp(215px,19vw,310px) minmax(0,1fr) clamp(320px,25vw,410px);
  }
  #work-workspace > .sidebar {
    padding-inline: clamp(16px,2vw,32px);
  }
  #editor {
    padding-inline: clamp(23px,2.7vw,60px);
  }
  .home-panel {
    grid-column: auto;
    position: sticky;
    top: 70px;
    display: flex;
    flex-direction: column;
    max-height: calc(100dvh - 70px);
    min-height: min(calc(100dvh - 70px), 420px);
    border-top: 0;
    border-right: 0;
    border-bottom: 0;
  }
  .home-panel-list {
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-gutter: stable;
  }
  .home-jump {
    display: none;
  }
}

.home-row>div:not(.order-actions) {
  min-width: 0;
}

.gate {
  max-width: 650px;
  margin: clamp(60px,11vh,150px) auto;
  padding: 22px;
}

.gate h2,dialog h2 {
  margin: 0 0 14px;
  font-size: clamp(1.5rem,3vw,2.4rem);
  font-weight: 550;
  letter-spacing: -.045em;
}

.gate p {
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 22px;
}

.gate .button {
  margin: 0 8px 8px 0;
}

.login-form {
  display: grid;
  gap: 18px;
  width: min(100%, 360px);
}

.login-form input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid #aaa99e;
  border-radius: 4px;
  background: var(--white);
  font-size: 1rem;
}

.login-form .button {
  justify-self: start;
  min-height: 44px;
  min-width: 90px;
  margin: 0;
}

dialog {
  border: 1px solid var(--line);
  border-radius: 7px;
  width: min(430px,calc(100vw - 32px));
  max-height: 90dvh;
  color: var(--ink);
  padding: 24px;
}

dialog::backdrop {
  background: #181a1875;
}

dialog .field {
  margin-top: 14px;
}

.dialog-actions {
  justify-content: flex-end;
}

.form-error {
  min-height: 1.2em;
  font-size: .86rem;
}

@media(max-width:850px) {
  .workspace {
    grid-template-columns: 215px minmax(0,1fr);
  }
  .sidebar {
    padding: 20px 12px;
  }
  .editor {
    padding: 23px 18px 60px;
  }
  .media-grid {
    grid-template-columns: 1fr;
  }
}

@media(max-width:640px) {
  .bar {
    min-height: 65px;
    gap: 5px;
  }
  .brand {
    font-size: 18px;
    margin-right: 8px;
  }
  .bar h1 {
    font-size: .9rem;
  }
  .account {
    font-size: .74rem;
    gap: 7px;
  }
  .account span {
    max-width: 34vw;
  }
  .action-bar {
    align-items: flex-start;
    gap: 5px;
    flex-wrap: wrap;
    padding: 9px 14px;
  }
  .action-bar #status {
    flex: 1 1 150px;
  }
  .actions {
    gap: 5px;
  }
  .actions .button {
    font-size: .76rem;
    padding: 7px;
  }
  .workspace {
    display: block;
  }
  .sidebar {
    position: static;
    height: auto;
    max-height: none;
    padding: 17px 15px;
    border-bottom: 1px solid var(--line);
  }
  .search {
    margin-top: 10px;
  }
  .filter {
    margin-bottom: 8px;
  }
  .sidebar nav {
    max-height: 130px;
    overflow: auto;
  }
  .list-item {
    padding: 6px 8px;
  }
  .editor {
    border: 0;
    padding: 22px 15px 60px;
  }
  .field-grid,.media-grid {
    grid-template-columns: 1fr;
  }
  .tabs {
    margin: 15px 0;
  }
  .order-actions {
    gap: 3px;
  }
  .mini {
    min-width: 30px;
    padding: 5px 7px;
  }
}
