:root { --accent:#d9502c; --accent-dark:#b8432a; --ink:#2b2a33; --muted:#6f6c79; --paper:#fff8f2; --line:#ece4dc; --soft:#f5efe9; --green:#2c8a56; --red:#c0342b; }
* { box-sizing:border-box; } [hidden] { display:none !important; }
body { margin:0; background:var(--paper); color:var(--ink); font:16px/1.45 system-ui, "Segoe UI", Roboto, sans-serif; }
h1 { font-size:26px; margin:0; } h2 { font-size:19px; margin:0 0 6px; } p { margin:0 0 12px; }
.muted { color:var(--muted); } .small { font-size:13px; }
.i { width:20px; height:20px; flex:none; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
button, .btn { display:inline-flex; align-items:center; justify-content:center; gap:8px; min-height:42px; padding:0 18px; border:0; border-radius:99px; background:var(--soft); color:var(--ink); font:600 15px/1 inherit; font-family:inherit; cursor:pointer; }
button:hover { filter:brightness(.96); } button:disabled { opacity:.5; cursor:default; }
button.primary { background:var(--accent); color:#fff; } button.danger { background:var(--red); color:#fff; }
button.icon { padding:0; width:38px; min-height:38px; }
:focus-visible { outline:3px solid #f2a65a; outline-offset:2px; }
label { display:block; font-weight:600; font-size:14px; margin-bottom:14px; }
input { display:block; width:100%; margin-top:6px; padding:11px 14px; border:1px solid #d8cdc3; border-radius:12px; background:#fff; color:var(--ink); font:16px inherit; font-family:inherit; }
input[type=range] { padding:0; accent-color:var(--accent); }
.error { color:var(--red); font-weight:600; min-height:22px; margin:4px 0 10px; }

.auth { min-height:100vh; display:grid; place-items:center; padding:20px; }
.card { background:#fff; border-radius:24px; padding:26px; border:1px solid var(--line); }
.auth .card { width:100%; max-width:430px; } .auth img { width:72px; border-radius:18px; } .auth h1 { margin:12px 0 4px; }
.auth button { width:100%; }

header { position:sticky; top:0; z-index:5; display:flex; align-items:center; gap:8px; padding:10px 24px; background:#fff; border-bottom:1px solid var(--line); flex-wrap:wrap; }
header img { width:40px; border-radius:10px; } header b { margin-right:auto; font-size:18px; }
header nav { display:flex; gap:4px; flex-wrap:wrap; }
header nav button { background:none; } header nav button[aria-current=page] { background:#fde6dd; color:var(--accent-dark); }
main { max-width:1280px; margin:0 auto; padding:24px; }
.head { display:flex; align-items:center; gap:12px; flex-wrap:wrap; margin-bottom:18px; } .head .grow { flex:1; min-width:220px; }
.notice { display:flex; gap:10px; align-items:center; padding:14px 18px; border-radius:16px; background:#fff0d1; color:#6b4700; margin-bottom:18px; }
.drop { border:2px dashed #e0c9b9; border-radius:20px; padding:20px; text-align:center; color:var(--muted); margin-bottom:22px; }
.drop.over { border-color:var(--accent); background:#fdeee7; }

.grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(168px, 1fr)); gap:16px; }
.tile { position:relative; background:#fff; border:1px solid var(--line); border-radius:18px; overflow:hidden; }
.tile > .pic { position:relative; aspect-ratio:1; background:#ede8e3; } .tile img { width:100%; height:100%; object-fit:cover; display:block; }
.tile[draggable=true] .pic { cursor:grab; } .tile.drag { opacity:.4; } .tile.target { outline:3px solid var(--accent); }
.tile.hid img { filter:grayscale(1); opacity:.45; }
.badge { position:absolute; top:8px; left:8px; background:#fff; border-radius:99px; padding:3px 10px; font-weight:700; font-size:13px; }
.badge.right { left:auto; right:8px; background:var(--ink); color:#fff; }
.tile .name { padding:10px 12px 2px; font-size:14px; font-weight:600; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.tile .info { padding:0 12px; } .tile .acts { display:flex; justify-content:space-between; padding:8px; }

.month { display:flex; align-items:center; gap:10px; margin:26px 0 12px; } .month h2 { margin:0; min-width:180px; text-align:center; text-transform:capitalize; }
.day.empty { border-style:dashed; background:none; } .day.empty .pic { display:grid; place-items:center; background:none; padding:0; width:100%; border-radius:0; color:var(--muted); min-height:0; }
.day.today { outline:3px solid #f2a65a; }

dialog { border:0; border-radius:26px; padding:26px; width:min(520px, calc(100vw - 24px)); color:var(--ink); max-height:92vh; overflow:auto; }
dialog.wide { width:min(900px, calc(100vw - 24px)); } dialog::backdrop { background:rgba(43,42,51,.6); }
.row { display:flex; gap:10px; justify-content:flex-end; flex-wrap:wrap; margin-top:16px; }
.files { display:grid; grid-template-columns:repeat(auto-fill, minmax(230px, 1fr)); gap:16px; margin:14px 0; }
.crop { position:relative; aspect-ratio:1; overflow:hidden; border-radius:14px; background:#ede8e3; cursor:move; touch-action:none; }
.crop img { position:absolute; max-width:none; user-select:none; pointer-events:none; }
.status { font-size:13px; font-weight:600; min-height:20px; } .status.ok { color:var(--green); } .status.ko { color:var(--red); } .status.warn { color:#8a5a00; }

.settings { display:grid; grid-template-columns:repeat(auto-fit, minmax(310px, 1fr)); gap:18px; align-items:start; }
.state { display:inline-flex; align-items:center; gap:6px; font-weight:700; } .state.on { color:var(--green); }
.qr { display:block; width:240px; margin:8px auto; } code { font-size:15px; word-break:break-all; }
.codes { display:grid; grid-template-columns:1fr 1fr; gap:8px; background:var(--soft); padding:16px; border-radius:14px; }
#toasts { position:fixed; bottom:20px; left:50%; transform:translateX(-50%); display:grid; gap:8px; z-index:20; }
.toast { background:var(--ink); color:#fff; padding:12px 20px; border-radius:99px; } .toast.ko { background:var(--red); }
@media (max-width:640px) {
  main { padding:16px; } header { padding:10px 12px; } header nav { width:100%; justify-content:space-between; }
  header nav button { padding:0 12px; font-size:14px; } .grid { grid-template-columns:repeat(2, 1fr); gap:10px; }
  .tile .acts { padding:4px; } button.icon { width:34px; min-height:38px; } .codes { grid-template-columns:1fr; }
}
