/* Layout: estudio de diseño — la foto y las preferencias arriba, tres propuestas tipo muestrario, luego la hoja de material */
:root {
  --bg: #eef0ef; --surface: #ffffff; --ink: #1d2422; --muted: #5d6865; --line: #d3d9d7;
  --accent: #1f6b5c; --accent-ink: #ffffff; --accent-soft: #dcebe7; --warn: #9a5b12; --warn-soft: #f6ead8;
  --font-display: "Sora", "Segoe UI", system-ui, sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --font-data: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141917; --surface: #1c2321; --ink: #e6ecea; --muted: #9aa7a3; --line: #2f3a37;
    --accent: #5fbfa8; --accent-ink: #0d1a17; --accent-soft: #1f3631; --warn: #e2a85a; --warn-soft: #372a19;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141917; --surface: #1c2321; --ink: #e6ecea; --muted: #9aa7a3; --line: #2f3a37;
  --accent: #5fbfa8; --accent-ink: #0d1a17; --accent-soft: #1f3631; --warn: #e2a85a; --warn-soft: #372a19;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 15px; line-height: 1.5; }
.wrap { max-width: 1200px; margin: 0 auto; padding-block: 28px 56px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: flex; flex-direction: column; gap: 18px; }
header.top { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px 24px; }
h1 { font-family: var(--font-display); font-size: clamp(24px, 3.4vw, 34px); font-weight: 700; letter-spacing: -0.02em; margin: 0; text-wrap: balance; }
h2 { font-family: var(--font-display); font-size: 17px; font-weight: 600; margin: 0 0 12px; display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
h2 .n { font-family: var(--font-data); font-size: 12px; color: var(--accent); font-weight: 500; }
.sub { color: var(--muted); margin: 4px 0 0; max-width: 66ch; }
.badge { font-family: var(--font-data); font-size: 12px; background: var(--accent-soft); color: var(--ink); padding: 6px 10px; border-radius: 6px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px; min-width: 0; }
.intake { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 760px) { .intake { grid-template-columns: minmax(0, 1fr); } }
.photo { aspect-ratio: 4 / 3; max-width: 100%; border-radius: 8px; background: var(--bg); border: 1px dashed var(--line); display: grid; place-items: center; overflow: hidden; cursor: pointer; position: relative; }
.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo .ph { text-align: center; color: var(--muted); font-size: 13px; padding: 16px; }
.prefs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
label.lbl { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 6px; }
input[type=number], select, textarea { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; }
textarea { resize: vertical; min-height: 44px; }
input[type=number] { font-family: var(--font-data); }
input:focus-visible, select:focus-visible, button:focus-visible, textarea:focus-visible, .photo:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 14px; }
.btn { font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); padding: 10px 18px; border-radius: 6px; cursor: pointer; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.hint { font-size: 13px; color: var(--muted); }
.status { font-size: 13.5px; color: var(--ink); background: var(--accent-soft); border-radius: 6px; padding: 8px 12px; }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.analysis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 18px; font-size: 13.5px; margin-top: 4px; }
.analysis dt { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; }
.analysis dd { margin: 0; }
.dots { display: inline-flex; gap: 4px; vertical-align: middle; }
.dots i { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; }
.props { display: grid; grid-template-columns: repeat(auto-fit, minmax(290px, 1fr)); gap: 16px; }
.prop { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.prop[aria-current="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.board { display: grid; grid-template-columns: 1.15fr 1fr; grid-template-rows: 1fr 1fr; gap: 3px; aspect-ratio: 16 / 10; max-width: 100%; background: var(--line); }
.board > div { background: var(--bg) center / cover no-repeat; position: relative; min-height: 0; }
.board .wall { grid-row: 1 / 3; }
.board .tag { position: absolute; left: 6px; bottom: 6px; font-family: var(--font-data); font-size: 10.5px; background: var(--surface); color: var(--ink); padding: 2px 6px; border-radius: 4px; max-width: calc(100% - 12px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prop .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.prop .style { font-family: var(--font-data); font-size: 11.5px; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.prop h3 { font-family: var(--font-display); font-size: 16px; margin: 0; line-height: 1.3; overflow-wrap: anywhere; }
.prop p { margin: 0; font-size: 14px; }
.prop .where { font-size: 13px; color: var(--muted); }
.prop .skus { font-family: var(--font-data); font-size: 11.5px; color: var(--muted); overflow-wrap: anywhere; }
.prop .btn { margin-top: auto; align-self: flex-start; }
.sheet { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 20px; align-items: start; }
@media (max-width: 860px) { .sheet { grid-template-columns: minmax(0, 1fr); } }
.dims { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
.dims .grp { grid-column: 1 / -1; font-family: var(--font-display); font-size: 14px; font-weight: 600; margin-top: 4px; }
.tbl { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; padding: 6px 4px; border-bottom: 1px solid var(--line); }
td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.num, th.num { text-align: right; font-family: var(--font-data); font-variant-numeric: tabular-nums; white-space: nowrap; }
tr.sec td { font-family: var(--font-display); font-weight: 600; font-size: 13px; color: var(--accent); border-bottom: none; padding-top: 14px; }
td small { display: block; color: var(--muted); font-size: 12px; }
td code { font-family: var(--font-data); font-size: 11.5px; color: var(--muted); }
.flag { display: inline-block; font-size: 10.5px; font-family: var(--font-data); background: var(--warn-soft); color: var(--warn); padding: 1px 6px; border-radius: 4px; margin-left: 4px; }
.note { font-size: 12.5px; color: var(--warn); background: var(--warn-soft); border-radius: 6px; padding: 8px 10px; margin-top: 8px; }
.bubble { background: var(--accent-soft); border-radius: 10px 10px 10px 2px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 14px; }
.err { color: var(--warn); font-size: 13px; margin: 8px 0 0; }
@media (prefers-reduced-motion: no-preference) { .prop { transition: box-shadow .15s, border-color .15s; } }

/* ---- portal: barra superior, login, admin ---- */
.topbar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; padding-block: 10px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar .brand { font-family: var(--font-display); font-weight: 700; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.topbar .brand span { color: var(--accent); }
.topbar nav { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: 14px; }
.topbar nav a { color: var(--accent); text-decoration: none; font-weight: 600; }
.topbar nav a:hover { text-decoration: underline; }
.topbar .who { color: var(--muted); font-size: 13px; }
.linkbtn { font: inherit; font-size: 14px; background: none; border: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; }
.pill { font-family: var(--font-data); font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--accent-soft); color: var(--ink); }
.auth { min-height: 100%; display: grid; place-items: center; padding-block: 40px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
.auth .card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 14px; }
.auth h1 { font-size: 24px; }
.auth input[type=text], .auth input[type=password] { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; }
.auth .btn { width: 100%; }
.admin-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; align-items: end; }
.form-row input[type=text], .form-row input[type=email] { width: 100%; font: inherit; color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 6px; padding: 9px 10px; }
.secret { font-family: var(--font-data); font-size: 15px; background: var(--accent-soft); padding: 10px 12px; border-radius: 6px; user-select: all; overflow-wrap: anywhere; }
.small { font-size: 12.5px; }
html, body { margin: 0; min-height: 100%; }
html { height: 100%; }
.mt { margin-top: 12px; }
.accent { color: var(--accent); }
[hidden] { display: none !important; }
img { max-width: 100%; }
