:root {
  --ink: #212e27;
  --muted: #56645b;
  --green: #285141;
  --deep: #172f27;
  --surface: #fff;
  --paper: #f6f7f3;
  --line: #dfe6de;
  --tint: #ebf2eb;
  --accent: #ac8249;
  --radius: 16px;
  font: 100%/1.55 -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--ink);
  background: var(--paper);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, input, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .58; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #a77339; outline-offset: 3px; }
a { color: var(--green); }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
h1 { font-size: clamp(1.7rem, 3.7vw, 2.45rem); font-weight: 690; line-height: 1.2; letter-spacing: -.04em; }
h2 { font-size: 1.24rem; line-height: 1.35; }
h3 { font-size: 1rem; }
.sr-only, .skip:not(:focus) { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
.skip:focus { position: fixed; top: 8px; left: 8px; z-index: 10; padding: 10px; background: white; }
.shell { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 24px 16px; display: flex; flex-direction: column; }
.brand { padding: 5px 10px 18px; }
.brand strong { display: block; font: 500 2rem/1.15 Georgia, serif; letter-spacing: .015em; color: var(--deep); }
.brand small { color: var(--muted); font-size: .82rem; }
.menu-group { margin-top: 15px; }
.menu-label { padding: 0 11px 4px; color: var(--muted); font-size: .76rem; }
.nav-button { width: 100%; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 10px; background: transparent; text-align: left; padding: 9px 11px; min-height: 42px; font-size: .875rem; }
.nav-button:hover, .nav-button[aria-current="page"] { background: var(--tint); color: var(--deep); }
.nav-button[aria-current="page"] { font-weight: 700; }
.nav-icon { width: 1.18rem; height: 1.18rem; display: grid; place-items: center; flex: none; font-size: 1.12rem; }
.workspace { min-width: 0; }
.topbar { position: sticky; z-index: 3; top: 0; min-height: 62px; padding: 8px clamp(16px, 3.3vw, 42px); background: var(--paper); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.top-name { font-size: .9rem; font-weight: 700; }
.mobile-brand, .bottom-nav { display: none; }
.connection { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--green); background: #fcfdfb; font-size: .76rem; font-weight: 660; white-space: nowrap; }
.content { padding: clamp(20px, 3.5vw, 42px); max-width: 1430px; margin-inline: auto; overflow-wrap: anywhere; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 22px; }
.page-heading p { color: var(--muted); margin-top: 7px; font-size: .92rem; }
.dashboard { display: grid; gap: 24px; }
.metrics { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 12px; }
.metric { display: flex; flex-direction: column; align-items: start; justify-content: space-between; min-height: 108px; gap: 7px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); text-align: left; }
.metric:hover { border-color: var(--green); }
.metric span { color: var(--muted); font-size: .875rem; }
.metric b { font: 500 2rem/1 Georgia, serif; color: var(--deep); font-variant-numeric: tabular-nums; }
.hero { background: var(--deep); color: white; border-radius: var(--radius); padding: clamp(17px, 3vw, 28px); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.hero p { color: #d6e5d9; font-size: .875rem; margin-top: 5px; }
.hero-actions, .actions { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.button { min-height: 44px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); padding: 9px 13px; font-weight: 650; font-size: .89rem; text-align: center; display: inline-flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none; }
.button:hover { border-color: var(--green); }
.primary { background: var(--green); border-color: var(--green); color: white; }
.primary:hover { background: var(--deep); }
.hero .button { background: white; color: var(--deep); border-color: white; }
.hero .secondary { background: transparent; color: white; border-color: #94ab9b; }
.flat { border-color: transparent; background: transparent; color: var(--green); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.section-head p { font-size: .875rem; color: var(--muted); }
.works-grid { list-style: none; display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 13px; margin: 0; padding: 0; }
.work-card { width: 100%; height: 100%; max-width: 100%; border: 1px solid var(--line); border-radius: var(--radius); padding: 0; overflow: hidden; display: grid; grid-template-rows: auto 1fr; text-align: left; background: white; }
.work-card:hover { border-color: var(--green); }
.cover { display: grid; place-items: center; background: radial-gradient(circle at 35% 25%,#f0f3ed,#e6ece4); color: var(--muted); min-width: 0; width: 100%; aspect-ratio: 1.66; overflow: hidden; font-size: .8rem; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.card-content { padding: 12px 13px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.work-code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .875rem; font-weight: 700; letter-spacing: .045em; }
.collection { color: var(--muted); font-size: .78rem; }
.work-title { font-weight: 680; font-size: 1rem; }
.card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin-top: 4px; color: var(--muted); font-size: .78rem; }
.pill { display: inline-flex; align-items: center; min-height: 23px; padding: 2px 7px; border-radius: 5px; background: #eef0ec; color: #414c44; font-weight: 650; font-size: .76rem; max-width: 100%; }
.pill.wait { background: #e7f2e9; color: #264d32; }
.pill.sold { background: #f3eee6; color: #664922; }
.pill.photo { background: #eaf0f6; color: #34536c; }
.filters { display: grid; grid-template-columns: minmax(180px, 1.28fr) repeat(3,minmax(118px,1fr)); align-items: end; gap: 10px; padding: 13px; background: white; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 16px; }
.field { display: grid; gap: 5px; min-width: 0; font-size: .875rem; font-weight: 650; }
.field input, .field select { width: 100%; min-width: 0; min-height: 45px; padding: 8px 10px; background: white; color: var(--ink); border: 1px solid #aab7ad; border-radius: 8px; font-size: 1rem; }
.field input::placeholder { color: var(--muted); }
.field select { appearance: none; padding-right: 24px; background-image: linear-gradient(45deg,transparent 50%,var(--muted) 50%),linear-gradient(135deg,var(--muted) 50%,transparent 50%); background-position: calc(100% - 15px) 52%,calc(100% - 10px) 52%; background-size: 5px 5px; background-repeat: no-repeat; }
.results-meta { display: flex; align-items: center; justify-content: space-between; min-height: 44px; font-size: .9rem; color: var(--muted); }
.empty, .planned { border: 1px solid var(--line); background: white; border-radius: var(--radius); padding: 24px; color: var(--muted); }
.empty h2, .planned h2 { color: var(--ink); margin-bottom: 6px; }
.back { padding-inline: 0; margin-bottom: 10px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 14px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: white; min-width: 0; }
.facts { display: grid; grid-template-columns: minmax(105px,auto) 1fr; gap: 8px 12px; margin: 14px 0 0; font-size: .9rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.photo-panel .actions { margin-top: 10px; }
.photo-panel .field { margin-top: 13px; max-width: 230px; }
.photo-status { margin-top: 10px; color: var(--muted); font-size: .875rem; }
.gallery-group { margin-top: 16px; }
.gallery-group h3 { margin-bottom: 7px; }
.gallery { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); list-style: none; padding: 0; gap: 8px; margin: 0; }
.gallery-button { display: block; width: 100%; border: 1px solid var(--line); background: white; border-radius: 9px; overflow: hidden; padding: 0; text-align: left; }
.gallery-button .cover { aspect-ratio: 1; }
.gallery-button small { display: block; padding: 5px; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.notice { border-radius: 9px; background: var(--tint); color: var(--ink); padding: 10px 12px; margin: 11px 0; font-size: .875rem; }
.notice:empty, #uploads:empty { display: none; }
.notice.error { background: #fff1eb; color: #722e13; }
.upload-list { list-style: none; padding: 0; display: grid; gap: 4px; margin: 10px 0 0; }
.upload-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 8px; background: var(--paper); font-size: .83rem; border-radius: 6px; }
.upload-list li span { min-width: 0; overflow-wrap: anywhere; }
.upload-list .button { min-height: 40px; flex: none; }
dialog { max-width: min(700px, calc(100% - 24px)); width: max-content; max-height: 94dvh; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); }
dialog::backdrop { background: #151e19b0; }
dialog img { max-height: min(68dvh, 650px); object-fit: contain; border-radius: 9px; margin-inline: auto; }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 9px; margin-bottom: 8px; }
.dialog-head h2 { font-size: 1rem; overflow-wrap: anywhere; }
.dialog-actions { margin-top: 8px; }
.mobile-menu { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.mobile-menu .menu-group { margin: 0; }
.mobile-menu .nav-button { min-height: 48px; }
@media (max-width: 1050px) {
  .shell { grid-template-columns: 184px minmax(0,1fr); }
  .sidebar { padding-inline: 12px; }
  .filters { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .works-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
}
@media (max-width: 750px) {
  .shell { display: block; }
  .sidebar { display: none; }
  .topbar { min-height: 53px; padding-inline: 14px; }
  .top-name { display: none; }
  .mobile-brand { display: block; color: var(--deep); font: 500 1.46rem/1 Georgia,serif; }
  .content { padding: 18px 13px calc(88px + env(safe-area-inset-bottom)); }
  .page-heading { margin-bottom: 16px; }
  .dashboard { gap: 16px; }
  .metrics { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
  .metric { min-height: 77px; padding: 9px 11px; border-radius: 12px; }
  .metric b { font-size: 1.7rem; }
  .bottom-nav { position: fixed; z-index: 4; bottom: 0; left: 0; right: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); padding: 3px 4px calc(3px + env(safe-area-inset-bottom)); background: white; border-top: 1px solid var(--line); }
  .bottom-nav .nav-button { flex-direction: column; justify-content: center; text-align: center; gap: 2px; padding: 4px 2px; min-height: 51px; font-size: .75rem; }
  .hero { align-items: start; flex-direction: column; }
}
@media (max-width: 480px) {
  .works-grid { grid-template-columns: 1fr; gap: 8px; }
  .work-card { grid-template-columns: 91px minmax(0,1fr); grid-template-rows: auto; }
  .work-card .cover { aspect-ratio: auto; height: 100%; min-height: 93px; }
  .card-content { padding: 8px 10px; gap: 2px; }
  .filters { padding: 9px; gap: 7px; }
  .filters .field:first-child, .filters .field:last-child { grid-column: 1 / -1; }
  .detail-grid { grid-template-columns: 1fr; }
  .photo-panel { grid-row: 1; }
  .mobile-menu { grid-template-columns: 1fr; gap: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  button { transition: background-color .15s, border-color .15s; }
}

.top-actions { display:flex; align-items:center; gap:5px; }
.signout { min-height:40px; padding-inline:6px; font-size:.75rem; white-space:nowrap; }

.login-card { margin: 12vh auto; max-width: 420px; background: var(--surface); border-radius: var(--radius); padding: clamp(20px, 5vw, 32px); border: 1px solid var(--line); width: calc(100% - 32px); }
.login-card .brand { padding-inline: 0; }
.login-card p { margin-block: 10px 18px; }
.top-actions { display:flex; align-items:center; gap:6px; min-width:0; }
.signout { min-height:42px; padding-inline:6px; font-size:.77rem; white-space:nowrap; }
.entry { display:grid; gap:11px; margin-top:14px; min-width:0; }
.entry > .button { justify-self:start; }
.field textarea { resize:vertical; min-height:78px; border:1px solid #aab7ad; border-radius:8px; padding:8px 10px; font:inherit; min-width:0; }
.check { display:flex; gap:10px; align-items:start; min-height:44px; font-size:.88rem; }
.check input { width:19px;height:19px; flex:none; }
details { margin-top:12px; }
summary { padding-block:9px; cursor:pointer; min-height:42px; font-weight:650; }
.record-list { display:grid; gap:10px; margin-top:10px; }
.record { border:1px solid var(--line); border-radius:12px; background:var(--surface); padding:13px; }
.record .facts { margin:7px 0 0; }
.block { margin-block:14px; }
.panel-actions { margin-block:12px; }
.list-action { margin-block:9px 2px; }
.row-list { list-style:none; padding:0; margin:12px 0 0; }
.row-list > li { padding:10px 0; border-bottom:1px solid var(--line); overflow-wrap:anywhere; }
.row-list .actions { margin-top:6px; }
.sale-panel { max-width:650px; }
.sale-search { display:flex; flex-wrap:wrap; align-items:end; gap:10px; margin-bottom:14px; }
.sale-search .field { width:min(100%, 27rem); }
.sale-work-summary { display:flex; gap:14px; align-items:center; margin-bottom:12px; }
.sale-work-summary .facts { margin:0; grid-template-columns:auto minmax(0,1fr); }
.sale-thumb { flex:none; width:68px; padding:0; border:1px solid var(--line); border-radius:12px; overflow:hidden; }
.sale-thumb .cover { aspect-ratio:1; }
.entry > details { min-width:0; }
.entry > details .field { margin-top:10px; }
.gallery-item { min-width:0; }
.photo-controls { display:flex; flex-wrap:wrap; gap:2px; margin-top:5px; }
.photo-controls .button { font-size:.72rem; min-height:42px; padding-inline:6px; }
.enlarged { min-width:min(320px,75vw); }
.notice-box { position:fixed; inset:auto 16px calc(16px + env(safe-area-inset-bottom)) auto; width:min(440px,calc(100% - 32px)); padding:12px; background:var(--deep); color:white; border-radius:10px; z-index:6; display:flex; gap:8px; flex-wrap:wrap; align-items:center; box-shadow:0 6px 20px #0003; }
.notice-box[hidden] { display:none; }
.notice-box.error { background:#722e13; }
.notice-box .button { color:var(--ink); min-height:38px; }
.pill.warn { background:#fce8d8; color:#743c16; }
.mobile-menu nav { width:100%; }
@media (max-width:750px) { .notice-box { bottom:calc(68px + env(safe-area-inset-bottom)); } }
@media (max-width:480px) {
  .topbar .connection { max-width:126px; overflow:hidden; text-overflow:ellipsis; }
  .gallery { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .sale-panel .entry > .button { width:100%; }
}

.brand-symbol { display: block; width: 50px; height: 50px; border-radius: 12px; margin-block-end: 9px; }
#install-app[hidden] { display: none; }
.sidebar .brand-symbol { width: 43px; height: 43px; }
.goal-progress { accent-color: #3f6a52; width: 100%; min-height: 13px; }
.goal-total { margin-block: .3rem; font-size: clamp(1.15rem, 5vw, 1.55rem); }
.goal-reached { color: #254f3b; font-weight: 650; }
.goal-month { color: var(--muted); margin-block: .2rem; }
.workspace-head { position:sticky; top:0; z-index:3; background:var(--paper); }
.workspace-head .topbar { position:static; }
.workspace-head .notice-box { position:static; width:auto; margin:0; border-radius:0; padding:6px clamp(8px,3vw,24px); box-shadow:none; font-size:.875rem; }
.workspace-head .notice-box > span { flex:1 1 160px; }
.workspace-head [data-reload] { min-height:42px; padding-inline:7px; white-space:nowrap; font-size:.77rem; }
.cover { position:relative; }
.cover img[data-thumb] { position:absolute; inset:0; opacity:0; }
.cover img[data-thumb].loaded { opacity:1; }
@media (prefers-reduced-motion: no-preference) {
  .cover img[data-thumb] { transition:opacity .15s ease-out; }
}
@media (max-width: 750px) {
  .content { padding-top:14px; }
  .panel { padding:12px; }
  .entry { gap:8px; }
  .entry > details .field { margin-top:8px; }
  .entry[data-form="work.create"] > .primary,
  .entry[data-form="work.edit"] > .primary,
  .entry[data-form="sale.create"] > .primary { position:sticky; bottom:calc(66px + env(safe-area-inset-bottom)); z-index:2; width:100%; box-shadow:0 2px 8px #172f2733; }
  .topbar .connection { overflow:hidden; text-overflow:ellipsis; max-width:125px; }
}
@media (max-width: 380px) {
  .topbar { gap: 4px; padding-inline: 7px; }
  .topbar .connection { max-width: 74px; padding-inline:4px; }
  .top-actions { gap:2px; }
  .mobile-brand { font-size: 1.15rem; }
  .signout { min-height: 44px; }
  .work-card .card-content { min-width: 0; }
  .work-title { overflow-wrap: anywhere; }
}
