:root {
    --bg: #f7f7f9;
    --card: #ffffff;
    --ink: #171923;
    --muted: #85899f;
    --soft: #eff0f5;
    --line: #e6e7ee;
    --folder: #8288a3;
    --accent: #df2038;
    --accent-dark: #be1830;
    --success: #16a34a;
    --danger: #dc2626;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }

body.trastero-page {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Montserrat, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-loading {
    display: grid;
    min-height: 100vh;
    color: var(--muted);
    font-weight: 700;
    place-items: center;
}

.app-shell {
    min-height: 100vh;
    max-width: 720px;
    margin: 0 auto;
    background: var(--card);
    overflow: visible;
    position: relative;
}

.trastero-home-page {
    background:
        radial-gradient(circle at 78% 18%, rgba(37,99,235,.16), transparent 30%),
        radial-gradient(circle at 16% 82%, rgba(223,32,56,.10), transparent 28%),
        #f8fafc;
}
.home-login-link {
    position: fixed;
    top: clamp(18px, 4vw, 34px);
    left: clamp(18px, 4vw, 34px);
    z-index: 20;
    display: grid;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(37,99,235,.34);
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    color: var(--ink);
    box-shadow: 0 18px 50px rgba(22,24,35,.10);
    backdrop-filter: blur(16px);
    place-items: center;
}
.home-login-link svg {
    width: 30px;
    height: 30px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.trastero-home {
    overflow: hidden;
    color: var(--ink);
}
.home-hero {
    display: grid;
    min-height: 100vh;
    align-items: center;
    gap: clamp(34px, 6vw, 84px);
    padding: clamp(80px, 9vh, 104px) clamp(24px, 7vw, 96px) clamp(34px, 6vh, 68px);
}
.home-copy {
    max-width: 760px;
}
.home-kicker {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .2em;
    text-transform: uppercase;
}
.home-copy h1 {
    max-width: 980px;
    margin: 0;
    font-size: clamp(3rem, 8vw, 6.2rem);
    font-weight: 800;
    letter-spacing: -.07em;
    line-height: .9;
}
.home-lead {
    max-width: 680px;
    margin: 22px 0 0;
    color: #5f6678;
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 500;
    line-height: 1.55;
}
.home-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 28px;
}
.home-button {
    display: inline-flex;
    min-height: 56px;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 18px 45px rgba(22,24,35,.18);
}
.home-button-soft {
    border: 1px solid rgba(37,99,235,.28);
    background: rgba(255,255,255,.78);
    color: var(--ink);
}
.home-visual {
    position: relative;
    display: grid;
    min-height: min(50vh, 470px);
    place-items: center;
}
.home-orbit {
    position: absolute;
    width: min(76vw, 540px);
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,.20), rgba(255,255,255,.28) 48%, transparent 70%);
    filter: blur(2px);
}
.home-main-icon {
    position: relative;
    width: min(54vw, 310px);
    border-radius: 34px;
    filter: drop-shadow(0 30px 62px rgba(37,99,235,.30));
}
.home-floating-card {
    position: absolute;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border: 1px solid rgba(37,99,235,.20);
    border-radius: 22px;
    background: rgba(255,255,255,.86);
    color: var(--ink);
    font-weight: 800;
    box-shadow: 0 20px 48px rgba(22,24,35,.14);
    backdrop-filter: blur(14px);
}
.home-floating-card img {
    width: 42px;
    height: 42px;
    object-fit: contain;
}
.home-floating-card-one { top: 12%; left: 4%; }
.home-floating-card-two { right: 2%; bottom: 16%; }
.home-feature-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    padding: 0 clamp(24px, 7vw, 96px) clamp(44px, 7vw, 88px);
}
.home-feature-grid article {
    min-height: 230px;
    padding: 28px;
    border: 1px solid rgba(37,99,235,.13);
    border-radius: 34px;
    background: rgba(255,255,255,.78);
    box-shadow: 0 20px 50px rgba(22,24,35,.08);
}
.home-feature-grid span {
    color: var(--accent);
    font-size: .88rem;
    font-weight: 900;
    letter-spacing: .16em;
}
.home-feature-grid h2 {
    margin: 22px 0 10px;
    font-size: clamp(1.35rem, 2.7vw, 2rem);
    letter-spacing: -.04em;
}
.home-feature-grid p {
    margin: 0;
    color: #62697b;
    font-weight: 500;
    line-height: 1.55;
}
.home-footer {
    display: grid;
    justify-items: center;
    padding: 8px clamp(24px, 7vw, 96px) 56px;
    text-align: center;
}
.home-footer a {
    color: var(--muted);
    font-size: .86rem;
    font-weight: 700;
    text-decoration: none;
}
.home-footer a:hover {
    color: var(--ink);
}
.trastero-login-page {
    background:
        radial-gradient(circle at 74% 18%, rgba(37,99,235,.16), transparent 30%),
        radial-gradient(circle at 16% 82%, rgba(223,32,56,.10), transparent 28%),
        #f8fafc;
}
.trastero-login-screen {
    display: grid;
    min-height: 100vh;
    padding: 72px 22px 32px;
    place-items: center;
}
.login-back-link {
    position: fixed;
    top: clamp(18px, 4vw, 34px);
    left: clamp(18px, 4vw, 34px);
    z-index: 20;
    display: grid;
    width: 54px;
    height: 54px;
    border: 1px solid rgba(37,99,235,.34);
    border-radius: 50%;
    background: rgba(255,255,255,.88);
    color: var(--ink);
    font-size: 1.8rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 18px 50px rgba(22,24,35,.10);
    backdrop-filter: blur(16px);
    place-items: center;
}
.trastero-login-card {
    width: min(100%, 440px);
    padding: 32px;
    border: 1px solid rgba(37,99,235,.16);
    border-radius: 34px;
    background: rgba(255,255,255,.88);
    box-shadow: 0 24px 70px rgba(22,24,35,.12);
    backdrop-filter: blur(18px);
}
.trastero-login-card > img {
    width: 82px;
    height: 82px;
    border-radius: 22px;
    box-shadow: 0 18px 40px rgba(37,99,235,.18);
}
.trastero-login-card h1 {
    margin: 0;
    font-size: clamp(2.15rem, 8vw, 3rem);
    font-weight: 800;
    letter-spacing: -.05em;
}
.trastero-login-card p {
    color: #62697b;
    font-weight: 500;
    line-height: 1.55;
}
.trastero-login-card form {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}
.trastero-login-card label {
    color: #555c70;
    font-size: .85rem;
    font-weight: 800;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.trastero-login-card input {
    width: 100%;
    min-height: 52px;
    padding: 0 16px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
    color: var(--ink);
    outline: none;
}
.trastero-login-card input:focus {
    border-color: rgba(37,99,235,.68);
    box-shadow: 0 0 0 4px rgba(37,99,235,.10);
}
.trastero-login-card button[type="submit"] {
    min-height: 56px;
    margin-top: 8px;
    border: 0;
    border-radius: 999px;
    background: var(--ink);
    color: #fff;
    font-weight: 800;
}
.trastero-login-card button[type="submit"]:disabled {
    opacity: .65;
    cursor: wait;
}
.trastero-login-message {
    margin: 4px 0 0;
    font-size: .92rem;
}
.trastero-login-message[data-type="error"] { color: var(--danger); }

.screen { min-height: 100vh; padding-bottom: 128px; background: var(--card); }
.topbar { position: relative; display: grid; gap: 18px; padding: 10px 28px 18px; }
.topbar-actions-bar { position: sticky; top: 0; z-index: 45; padding: 14px 28px 8px; background: rgba(255,255,255,.92); backdrop-filter: blur(12px); }
.topbar-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.topbar-left { display: flex; min-width: 0; align-items: center; gap: 16px; }
.title-block { min-width: 0; }
.title-block h1 { margin: 0; overflow-wrap: anywhere; font-size: clamp(2.1rem, 8vw, 3.7rem); font-weight: 700; letter-spacing: -.03em; line-height: .98; }
.topbar .title-block h1 { font-size: clamp(1.75rem, 7.6vw, 2.55rem); letter-spacing: -.02em; }
.breadcrumb { overflow: hidden; max-width: 100%; margin-top: 6px; color: var(--muted); font-size: .95rem; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.entity-code { margin-top: 8px; color: var(--muted); font-size: .95rem; font-weight: 600; letter-spacing: .02em; }

.round-button, .pill-button, .icon-only {
    border: 1px solid rgba(37,99,235,.42);
    background: #fff;
    color: var(--ink);
    box-shadow: 0 16px 45px rgba(22, 24, 35, .10);
}
.round-button { display: grid; flex: 0 0 auto; width: 64px; height: 64px; border-radius: 50%; font-size: 2.15rem; line-height: 1; place-items: center; }
.round-icon { display: block; width: 48px; height: 48px; object-fit: contain; }
.pill-button { display: flex; min-height: 54px; align-items: center; gap: 16px; padding: 0 18px; border-radius: 999px; font-size: 1.25rem; }
.icon-only { display: grid; width: 54px; height: 54px; border-radius: 50%; font-size: 1.5rem; place-items: center; }
.icon-only-inline { display: grid; border: 0; background: transparent; color: var(--ink); font-size: 1.45rem; font-weight: 700; place-items: center; }
.action-icon { display: block; width: 1.45em; height: 1.45em; object-fit: contain; }

.folder-hero { overflow: hidden; border-radius: 24px; background: #f5f5f7; }
.folder-hero img { display: block; width: 100%; height: 260px; object-fit: contain; }

.stats { display: flex; gap: clamp(34px, 14vw, 74px); padding: 0 28px 24px; border-bottom: 1px solid var(--line); }
.stat { display: flex; align-items: baseline; gap: 9px; }
.stat span, .stat strong { display: inline; color: var(--muted); font-size: clamp(1.1rem, 4vw, 1.65rem); }
.stat strong { color: #5d6272; font-weight: 700; }
.notes-panel { padding: 18px 28px; border-bottom: 1px solid var(--line); color: #3f4352; font-size: 1rem; font-weight: 500; line-height: 1.45; }
.notes-panel strong { color: var(--ink); font-weight: 700; }

.content-list { display: grid; }
.content-row {
    display: grid;
    grid-template-columns: 126px minmax(0, 1fr) 44px;
    gap: 22px;
    align-items: center;
    min-height: 164px;
    padding: 24px 28px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: white;
    color: inherit;
    text-align: left;
    text-decoration: none;
}
.thumb {
    display: grid;
    width: 126px;
    height: 126px;
    border-radius: 13px;
    background: #81879f;
    color: #dfe2ec;
    font-size: 3.1rem;
    object-fit: cover;
    place-items: center;
}
.thumb-placeholder { padding: 0; background: #e4e6ef; object-fit: contain; }
.item-thumb { background: #e4e6ef; color: #a2a8bb; }
.row-copy { min-width: 0; }
.code { display: block; margin-bottom: 8px; color: var(--muted); font-size: 1rem; font-weight: 400; letter-spacing: .04em; }
.row-title { display: -webkit-box; overflow: hidden; color: var(--ink); font-size: clamp(1.18rem, 4.7vw, 1.65rem); font-weight: 700; letter-spacing: -.015em; line-height: 1.1; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; color: var(--muted); font-size: 1.05rem; font-weight: 400; }
.meta-part { display: inline-flex; align-items: center; gap: 4px; }
.meta-icon { width: 1.25em; height: 1.25em; border-radius: 4px; object-fit: cover; }
.meta-separator { color: #a5a9ba; }
.row-menu { align-self: start; border: 0; background: transparent; color: var(--ink); font-size: 1.7rem; font-weight: 700; }

.empty-state { padding: 48px 28px; color: var(--muted); font-size: 1.1rem; font-weight: 700; text-align: center; }
.fab { position: fixed; right: max(24px, calc((100vw - 720px) / 2 + 24px)); bottom: 24px; z-index: 20; display: grid; width: 76px; height: 76px; border: 0; border-radius: 50%; background: #2563eb; color: white; font-size: 2.75rem; line-height: 1; place-items: center; box-shadow: 0 16px 44px rgba(37, 99, 235, .32); }
.fab:hover { background: #1d4ed8; }

.photo-gallery-row {
    display: flex;
    max-width: 100%;
    align-items: center;
    margin-top: 18px;
    gap: 12px;
}
.photo-stack {
    display: flex;
    max-width: min-content;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
}
.photo-stack-item {
    position: relative;
    display: block;
    width: 98px;
    height: 98px;
    overflow: hidden;
    padding: 0;
    border: 4px solid white;
    border-radius: 22px;
    background: var(--soft);
    box-shadow: 0 14px 34px rgba(22,24,35,.14);
}
.photo-stack-item + .photo-stack-item { margin-left: -18px; }
.photo-stack-item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.photo-stack-more {
    position: absolute;
    inset: 0;
    display: grid;
    background: rgba(23,25,35,.54);
    color: white;
    font-size: 1.4rem;
    font-weight: 700;
    place-items: center;
}
.photo-empty-action {
    display: grid;
    width: 74px;
    height: 74px;
    margin: 14px 0 0 auto;
    border: 0;
    border-radius: 50%;
    background: #f6f6f9;
    color: var(--ink);
    box-shadow: 0 12px 34px rgba(22,24,35,.08);
    place-items: center;
}
.photo-gallery-row .photo-empty-action { flex: 0 0 auto; margin: 0; }

.detail-grid { display: grid; gap: 1px; margin: 0 28px 28px; overflow: hidden; border-radius: 18px; background: var(--line); }
.detail-row { display: grid; grid-template-columns: 120px 1fr; gap: 14px; padding: 18px; background: white; }
.detail-row span { color: var(--muted); font-weight: 400; }
.detail-row strong { overflow-wrap: anywhere; text-align: right; }

.sheet-backdrop, .modal-backdrop { position: fixed; inset: 0; z-index: 60; display: grid; background: rgba(0,0,0,.24); }
.sheet { align-self: end; width: min(720px, 100%); margin: 0 auto; padding: 22px; border-radius: 34px 34px 0 0; background: white; box-shadow: 0 -24px 60px rgba(0,0,0,.18); }
.sheet-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 18px; }
.sheet h2, .modal h2 { margin: 0 0 18px; font-size: 1.7rem; letter-spacing: -.04em; }
.sheet-header h2 { min-width: 0; margin: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-header-action { display: grid; width: 48px; height: 48px; flex: 0 0 auto; border: 1px solid rgba(37,99,235,.42); border-radius: 50%; background: #fff; color: #2563eb; box-shadow: 0 12px 28px rgba(37,99,235,.12); place-items: center; }
.sheet-header-action svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sheet-actions { display: grid; gap: 12px; }
.button {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 0;
    border-radius: 18px;
    background: var(--ink);
    color: white;
    font-weight: 700;
    text-decoration: none;
}
.sheet-actions button, .sheet-actions a {
    display: flex;
    min-height: 58px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 2px solid #2563eb;
    border-radius: 18px;
    background: #fff;
    color: #2563eb;
    font-weight: 700;
    text-decoration: none;
}
.button-muted { background: #f0f1f6; color: var(--ink); }
.button-danger { background: #fee2e2; color: var(--danger); }
.button-success { background: #dcfce7; color: #15803d; }
.sheet-actions .button-muted, .sheet-actions .button-danger { border-color: #2563eb; background: #fff; color: #2563eb; }

.modal-backdrop { z-index: 110; place-items: end center; }
.modal { width: min(720px, 100%); max-height: 88vh; overflow: auto; padding: 28px; border-radius: 34px 34px 0 0; background: white; box-shadow: 0 -20px 60px rgba(0,0,0,.22); }
.tree-picker-backdrop .modal { display: flex; width: min(720px, 100%); height: min(88vh, 900px); flex-direction: column; overflow: hidden; }
.modal-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.modal-close { border: 0; background: transparent; color: var(--ink); font-size: 2rem; }
label { display: block; margin: 16px 0 8px; color: var(--muted); font-size: .9rem; font-weight: 700; text-transform: uppercase; }
.check-row { display: flex; align-items: center; gap: 10px; margin: 16px 0; color: var(--ink); font-size: .95rem; font-weight: 500; text-transform: none; }
.check-row input { width: auto; }
input, textarea, select { width: 100%; padding: 16px; border: 1px solid var(--line); border-radius: 16px; background: #fff; color: var(--ink); }
textarea { min-height: 112px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--folder); outline: 0; box-shadow: 0 0 0 4px rgba(130,136,163,.12); }
.form-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.picker-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; }
.picker-label { min-height: 54px; padding: 16px; border-radius: 16px; background: #f6f7fb; color: var(--muted); font-weight: 600; }

.search-panel {
    position: absolute;
    top: 78px;
    right: 28px;
    left: 28px;
    z-index: 30;
    padding: 14px;
    border: 1px solid rgba(255,255,255,.86);
    border-radius: 24px;
    background: rgba(255,255,255,.96);
    box-shadow: 0 18px 50px rgba(22,24,35,.16);
    backdrop-filter: blur(12px);
}
.search-results { display: grid; gap: 10px; margin-top: 14px; }
.search-result { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--ink); text-decoration: none; }
.search-result small { color: var(--muted); font-weight: 600; }
.photos-list { display: flex; gap: 14px; margin-top: 18px; overflow-x: auto; padding-bottom: 10px; }
.photo-tile { flex: 0 0 118px; }
.photo-thumb-button { position: relative; display: block; width: 118px; height: 118px; overflow: hidden; padding: 0; border: 0; border-radius: 18px; background: var(--soft); }
.photo-thumb-button img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cover-badge { position: absolute; right: 8px; bottom: 8px; padding: 4px 8px; border-radius: 999px; background: rgba(23,25,35,.72); color: white; font-size: .68rem; font-weight: 700; }
.photo-tile-actions { display: flex; justify-content: center; gap: 10px; margin-top: 10px; }
.photo-icon-action { display: grid; width: 40px; height: 40px; border: 0; border-radius: 50%; background: #f0f1f6; font-size: 1.2rem; font-weight: 700; line-height: 1; place-items: center; }
.cover-action { color: #2563eb; }
.delete-action { color: var(--danger); }
.photo-upload-button { gap: 10px; }

.photo-viewer-backdrop { position: fixed; inset: 0; z-index: 95; display: grid; background: rgba(10,12,20,.88); place-items: center; }
.photo-viewer { position: relative; display: grid; width: min(720px, 100%); height: min(92vh, 900px); place-items: center; }
.photo-viewer img { max-width: 100%; max-height: 100%; object-fit: contain; }
.photo-viewer-close, .photo-viewer-nav { position: absolute; display: grid; border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink); box-shadow: 0 12px 34px rgba(0,0,0,.24); place-items: center; }
.photo-viewer-close { top: 18px; right: 18px; width: 54px; height: 54px; font-size: 2rem; }
.photo-viewer-nav { top: 50%; width: 58px; height: 58px; font-size: 2.4rem; transform: translateY(-50%); }
.photo-viewer-nav:disabled { opacity: .35; }
.photo-viewer-prev { left: 16px; }
.photo-viewer-next { right: 16px; }
.photo-viewer-controls { position: absolute; bottom: 18px; left: 50%; display: flex; align-items: center; gap: 10px; transform: translateX(-50%); }
.photo-viewer-count, .photo-viewer-pill { display: grid; min-height: 42px; padding: 8px 14px; border: 0; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--ink); font-weight: 700; box-shadow: 0 12px 34px rgba(0,0,0,.20); place-items: center; }
.photo-viewer-pill { min-width: 42px; font-size: 1.15rem; }
.confirm-photo-thumb { display: block; width: 148px; height: 148px; margin: 0 auto 16px; border-radius: 20px; object-fit: cover; box-shadow: 0 14px 34px rgba(22,24,35,.16); }

.tree-list { display: grid; align-content: start; gap: 4px; flex: 1; margin-top: 18px; overflow-y: auto; padding-bottom: 24px; }
.tree-row { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 8px; align-items: center; min-height: 50px; margin-left: calc(var(--level, 0) * 22px); padding: 7px 10px; border: 0; border-radius: 14px; background: transparent; color: var(--ink); text-align: left; }
.tree-row:hover, .tree-row.selected { background: #f2f3f7; }
.tree-row.disabled { color: #c4c7d2; cursor: not-allowed; }
.tree-toggle, .tree-toggle-spacer { display: grid; width: 28px; height: 28px; color: var(--folder); font-size: 1.35rem; font-weight: 700; place-items: center; }
.tree-copy { display: flex; min-width: 0; align-items: center; gap: 10px; }
.tree-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tree-select { padding: 8px 10px; border-radius: 999px; background: #f0f1f6; color: var(--folder); font-size: .78rem; font-weight: 700; }

.toast { position: fixed; right: 18px; bottom: 18px; z-index: 90; max-width: min(420px, calc(100vw - 36px)); padding: 14px 16px; border-radius: 14px; background: var(--ink); color: white; font-weight: 600; box-shadow: 0 12px 36px rgba(0,0,0,.25); }
.toast.error { background: var(--danger); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }

.label-preview-wrap { display: grid; justify-items: center; padding: 8px 0 18px; }
.print-label { display: grid; width: 60mm; height: 40mm; align-content: center; justify-items: center; padding: 2.4mm; border: 1px dashed #cbd5e1; background: #fff; color: #111827; text-align: center; }
.label-title { display: -webkit-box; max-width: 100%; overflow: hidden; font-size: 9pt; font-weight: 700; line-height: 1.05; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.label-type, .label-code, .label-path { max-width: 100%; overflow: hidden; color: #4b5563; font-size: 7pt; line-height: 1.15; text-overflow: ellipsis; white-space: nowrap; }
.label-qr { width: 19mm; height: 19mm; margin-top: 1mm; }
.label-actions { display: grid; gap: 10px; }
.scanner-box { display: grid; gap: 14px; }
.scanner-box #scanner-reader { overflow: hidden; border-radius: 20px; background: #111827; }
.scanner-box video { width: 100%; max-height: 58vh; object-fit: cover; }
.scanner-box p { margin: 0; color: var(--muted); text-align: center; }
.public-topbar { padding-top: 36px; }
.public-icon { width: 118px; height: 118px; border-radius: 24px; background: #e4e6ef; object-fit: contain; }
.public-cover { object-fit: cover; }
.public-card { display: grid; min-height: 100vh; align-content: center; padding: 28px; color: var(--muted); text-align: center; }
.public-readonly { margin: 0 28px; color: var(--muted); font-size: .95rem; text-align: center; }
.public-gallery { display: flex; gap: 10px; overflow-x: auto; padding: 0 28px 20px; }
.public-gallery-thumb { width: 92px; height: 92px; flex: 0 0 auto; padding: 0; border: 0; border-radius: 18px; background: transparent; box-shadow: 0 12px 28px rgba(22,24,35,.12); overflow: hidden; }
.public-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.public-photo-warning { margin: 0 28px 20px; color: var(--muted); font-size: .9rem; }
.public-content-list { border-top: 1px solid var(--line); }
.public-content-row { grid-template-columns: 126px minmax(0, 1fr); cursor: default; }

@media print {
    @page { size: 60mm 40mm; margin: 0; }
    html, body.trastero-page { width: 60mm; height: 40mm; margin: 0 !important; padding: 0 !important; overflow: hidden !important; background: #fff; }
    body.trastero-page > :not(.modal-backdrop) { display: none !important; }
    .modal-backdrop { position: fixed !important; inset: 0 !important; display: block !important; width: 60mm !important; height: 40mm !important; padding: 0 !important; background: #fff !important; }
    .modal { display: block !important; width: 60mm !important; height: 40mm !important; max-height: none !important; padding: 0 !important; overflow: hidden !important; border-radius: 0 !important; box-shadow: none !important; }
    .modal > :not(.label-preview-wrap), .label-actions { display: none !important; }
    .label-preview-wrap { display: block !important; padding: 0 !important; }
    .print-label { display: grid !important; width: 60mm !important; height: 40mm !important; border: 0 !important; box-shadow: none !important; }
}

@media (min-width: 760px) {
    body.trastero-page { padding: 18px; }
    body.trastero-home-page { padding: 0; }
    .app-shell { border-radius: 36px; box-shadow: 0 24px 80px rgba(22,24,35,.14); }
    .sheet, .modal { border-radius: 34px; align-self: center; }
    .tree-picker-backdrop .modal { height: min(86vh, 900px); }
}

@media (min-width: 980px) {
    .home-hero { grid-template-columns: minmax(0, 1.05fr) minmax(360px, .95fr); }
    .home-feature-grid { margin-top: 0; }
}

@media (max-width: 520px) {
    .home-login-link { width: 52px; height: 52px; }
    .home-login-link svg { width: 27px; height: 27px; }
    .home-hero { padding: 92px 24px 42px; }
    .home-copy h1 { font-size: clamp(3rem, 15vw, 4.8rem); }
    .home-actions { display: grid; }
    .home-button { width: 100%; }
    .home-visual { min-height: 310px; }
    .home-main-icon { width: min(72vw, 260px); }
    .home-floating-card { padding: 10px 12px; font-size: .86rem; }
    .home-floating-card img { width: 34px; height: 34px; }
    .home-feature-grid { grid-template-columns: 1fr; padding: 0 24px 42px; }
    .home-feature-grid article { min-height: auto; }
    .screen { padding-bottom: 96px; }
    .topbar { gap: 14px; padding: 8px 20px 14px; }
    .topbar-actions-bar { padding: 10px 20px 8px; }
    .topbar-actions { gap: 12px; }
    .topbar-left { gap: 12px; }
    .round-button { width: 54px; height: 54px; font-size: 1.85rem; }
    .round-icon { width: 42px; height: 42px; }
    .pill-button { min-height: 50px; gap: 12px; padding: 0 14px; }
    .icon-only-inline { font-size: 1.1rem; }
    .action-icon { width: 1.5em; height: 1.5em; }
    .folder-hero img { height: 210px; }
    .topbar .title-block h1 { font-size: clamp(1.55rem, 8.5vw, 2.2rem); }
    .breadcrumb, .entity-code { margin-top: 4px; font-size: .76rem; }
    .search-panel { top: 70px; right: 20px; left: 20px; padding: 12px; border-radius: 20px; }
    .stats { gap: 34px; padding: 0 28px 20px; }
    .content-row { grid-template-columns: 76px minmax(0, 1fr) 28px; min-height: 112px; gap: 16px; padding: 14px 20px; }
    .public-content-row { grid-template-columns: 76px minmax(0, 1fr); }
    .thumb { width: 76px; height: 76px; border-radius: 10px; font-size: 1.8rem; }
    .code { margin-bottom: 6px; font-size: .82rem; letter-spacing: .08em; }
    .row-meta { margin-top: 7px; font-size: .9rem; }
    .row-menu { font-size: 1.35rem; }
    .photo-gallery-row { margin-top: 14px; gap: 10px; }
    .photo-stack-item { width: 90px; height: 90px; border-radius: 18px; }
    .photo-stack-item + .photo-stack-item { margin-left: -16px; }
    .photo-empty-action { width: 62px; height: 62px; margin-top: 10px; }
    .photos-list { gap: 12px; }
    .photo-tile { flex-basis: 104px; }
    .photo-thumb-button { width: 104px; height: 104px; border-radius: 16px; }
    .photo-icon-action { width: 36px; height: 36px; }
    .photo-viewer { height: 100vh; }
    .photo-viewer-close { top: 16px; right: 16px; width: 48px; height: 48px; }
    .photo-viewer-nav { width: 50px; height: 50px; font-size: 2rem; }
    .fab { width: 60px; height: 60px; font-size: 2.15rem; right: 24px; bottom: 24px; }
}
