/* Studio (owner area) — uses tokens.css + site.css. See DESIGN.md. */

.studio-pill { font: var(--weight-medium) var(--text-xs)/1 var(--font-mono); padding: var(--space-1) var(--space-2); border-radius: var(--radius-pill); border: 1px solid var(--border-strong); color: var(--text-muted); }
.nav .container { flex-wrap: wrap; }
.crumb { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); min-width: 0; }
.crumb .sep { color: var(--border-strong); }
.crumb [aria-current] { color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.studio-main { padding-top: var(--space-6); padding-bottom: var(--space-9); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-5); }
.page-head h1 { font-size: var(--text-2xl); line-height: var(--lh-2xl); }
.page-head p { color: var(--text-muted); margin-top: var(--space-2); }

/* Storage meter */
.meter { display: flex; flex-direction: column; gap: 6px; min-width: 240px; }
.meter-row { display: flex; justify-content: space-between; font: var(--text-xs)/var(--lh-xs) var(--font-mono); color: var(--text-muted); }
.meter-bar { height: 6px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.meter-bar span { display: block; height: 100%; background: var(--primary); width: 0; }

/* Tabs */
.tabs { display: flex; gap: var(--space-1); border-bottom: 1px solid var(--border); margin-bottom: var(--space-2); overflow-x: auto; }
.tab { height: 44px; padding: 0 14px; border: 0; background: transparent; cursor: pointer; font: var(--weight-medium) var(--text-sm) var(--font-sans); color: var(--text-muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--primary); }
.tab .n { margin-left: 6px; font: var(--text-xs) var(--font-mono); color: var(--text-muted); }

/* Work table */
.table-wrap { overflow-x: auto; }
.work-table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: var(--text-sm); }
.work-table th { text-align: left; padding: var(--space-3) var(--space-2); font: var(--weight-medium) var(--text-xs) var(--font-mono); letter-spacing: var(--tracking-label); text-transform: uppercase; color: var(--text-muted); }
.work-table td { padding: var(--space-3) var(--space-2); border-top: 1px solid var(--border); vertical-align: middle; }
.work-table .mono { font-size: var(--text-xs); color: var(--text-muted); }
.work-cell { display: flex; align-items: center; gap: var(--space-3); }
.thumb-sm { width: 64px; height: 48px; flex: none; border-radius: var(--radius-sm); background: var(--stage); border: 1px solid var(--border); display: grid; place-items: center; color: var(--border-strong); overflow: hidden; }
.thumb-sm img { width: 100%; height: 100%; object-fit: cover; }
.work-name { display: flex; flex-direction: column; }
.work-name a { color: var(--text); font-weight: var(--weight-medium); }
.status { display: inline-flex; align-items: center; height: 24px; padding: 0 10px; border-radius: var(--radius-pill); font: var(--weight-medium) var(--text-xs)/1 var(--font-mono); border: 1px solid var(--border); }
.status-public { color: var(--success); }
.status-draft { color: var(--warning); }
.status-hidden { color: var(--text-muted); border-style: dashed; border-color: var(--border-strong); }
.row-actions { display: flex; justify-content: flex-end; gap: var(--space-1); }
/* Phones: each row becomes a card (work, media + date, status, actions) */
@media (max-width: 699px) {
  .work-table { min-width: 0; }
  .work-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .work-table tr { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-3); padding: var(--space-4) 0; border-top: 1px solid var(--border); }
  .work-table td { display: block; padding: 0; border: 0; }
  .work-table td:nth-child(1) { grid-column: 1 / -1; }
  .work-table td:nth-child(2) { grid-column: 1 / -1; }
  .work-table td:nth-child(3) { align-self: center; }
  .work-table td:nth-child(4) { display: none; }
  .work-table td:nth-child(5) { align-self: center; }
}
.btn-sm { height: 36px; padding: 0 var(--space-3); font-size: 13px; }
.btn-danger { color: var(--error); }
.btn-danger:hover { background: var(--surface-2); color: var(--error); }

/* Banner */
.banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 14px var(--space-4); margin-bottom: var(--space-5); border: 1px solid var(--success); border-radius: var(--radius-md); background: var(--surface); }
.banner.is-error { border-color: var(--error); }
.banner-msg { display: flex; align-items: center; gap: 10px; }
.banner-actions { display: flex; gap: var(--space-2); font-size: var(--text-sm); }

/* Edit layout */
.edit-layout { display: flex; flex-wrap: wrap; gap: var(--space-6); align-items: flex-start; }
.edit-main { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-6); }
.edit-side { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 1000px) { .edit-side { position: sticky; top: calc(var(--nav-height) + var(--space-4)); } }
.edit-section { display: flex; flex-direction: column; gap: var(--space-4); }
.edit-section h2, .side-card h2 { font-size: var(--text-lg); line-height: var(--lh-lg); }
.side-card h2 { font-size: var(--text-base); }
.side-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-4); }

/* Drop zone */
.dropzone { position: relative; border: 1px dashed var(--border-strong); border-radius: var(--radius-md); background: var(--stage); padding: var(--space-7) var(--space-5); display: flex; flex-direction: column; align-items: center; gap: var(--space-3); text-align: center; cursor: pointer; transition: border-color var(--duration-fast) var(--ease); }
.dropzone.is-over, .dropzone:hover { border-color: var(--primary); }
.dropzone:focus-within { outline: 2px solid var(--focus); outline-offset: 2px; }
.dropzone .icon { width: 40px; height: 40px; stroke-width: 1.2; color: var(--text-muted); }
.dropzone strong { font-weight: var(--weight-medium); }
.dropzone .hint { font: var(--text-xs)/var(--lh-xs) var(--font-mono); color: var(--text-muted); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.fake-btn { height: 36px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-strong); display: inline-flex; align-items: center; font-size: var(--text-sm); }

/* File list */
.file-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.file-list:empty { display: none; }
.file-row { display: flex; align-items: center; gap: var(--space-3); padding: 10px var(--space-3); background: var(--surface); }
.file-row + .file-row { border-top: 1px solid var(--border); }
.file-thumb { width: 56px; height: 42px; flex: none; border-radius: var(--radius-sm); background: var(--stage); border: 1px solid var(--border); display: grid; place-items: center; font: var(--text-xs) var(--font-mono); color: var(--text-muted); overflow: hidden; }
.file-thumb img { width: 100%; height: 100%; object-fit: cover; }
.file-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.file-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); }
.file-name { font-size: var(--text-sm); font-weight: var(--weight-medium); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.file-meta { font: var(--text-xs) var(--font-mono); color: var(--text-muted); }
.file-status { font-size: var(--text-xs); color: var(--text-muted); }
.file-status.ok { color: var(--success); }
.file-status.err { color: var(--error); }
.progress { height: 4px; border-radius: var(--radius-pill); background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; width: 0; background: var(--primary); transition: width var(--duration) var(--ease); }
.cover-btn { height: 32px; padding: 0 10px; border-radius: var(--radius-pill); cursor: pointer; font: var(--weight-medium) var(--text-xs)/1 var(--font-mono); background: transparent; color: var(--text); border: 1px solid var(--border-strong); white-space: nowrap; }
.cover-btn[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }

/* Form fields */
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.field .help { font-weight: var(--weight-regular); color: var(--text-muted); font-size: var(--text-xs); }
.field .err-text { font-weight: var(--weight-regular); color: var(--error); font-size: var(--text-xs); }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
@media (max-width: 559px) { .field-row { grid-template-columns: 1fr; } }
.control { width: 100%; box-sizing: border-box; height: 44px; padding: 0 var(--space-3); background: var(--surface-2); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-sm); font: var(--weight-regular) 15px var(--font-sans); }
textarea.control { height: auto; min-height: 120px; padding: 10px var(--space-3); resize: vertical; line-height: 1.5; }
.control:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.control[aria-invalid="true"] { border-color: var(--error); }
.tag-input { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-height: 44px; box-sizing: border-box; padding: 6px var(--space-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); }
.tag-input:focus-within { outline: 2px solid var(--focus); border-color: var(--focus); }
.tag-chip { display: inline-flex; align-items: center; gap: 4px; font: var(--weight-medium) var(--text-xs)/1 var(--font-mono); padding: 4px 4px 4px 8px; border-radius: var(--radius-pill); background: var(--surface); border: 1px solid var(--border-strong); color: var(--text); }
.tag-chip button { width: 20px; height: 20px; border: 0; border-radius: var(--radius-pill); background: transparent; color: var(--text-muted); cursor: pointer; font-size: 14px; line-height: 1; }
.tag-chip button:hover { color: var(--text); background: var(--surface-2); }
.tag-input input { flex: 1; min-width: 140px; height: 30px; border: 0; padding: 0 4px; background: transparent; color: var(--text); font: 15px var(--font-sans); outline: none; }

/* Visibility radios */
.vis-group { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.vis-group legend { padding: 0; margin-bottom: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.vis-option { display: flex; gap: var(--space-3); align-items: flex-start; padding: 10px var(--space-3); border-radius: var(--radius-sm); border: 1px solid var(--border); cursor: pointer; }
.vis-option:has(input:checked) { border-color: var(--primary); background: var(--surface-2); }
.vis-option input { margin-top: 4px; accent-color: var(--primary); }
.vis-option span { display: flex; flex-direction: column; font-size: var(--text-sm); font-weight: var(--weight-medium); }
.vis-option small { font-size: 13px; font-weight: var(--weight-regular); color: var(--text-muted); }
.check-row { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); font-size: var(--text-sm); }
.check-row input { width: 18px; height: 18px; accent-color: var(--primary); }

.danger-zone { border-color: var(--border); }
.danger-zone p { font-size: var(--text-sm); color: var(--text-muted); }
