:root {
    --teal: #0ea5a4;
    --teal-dark: #0c8a89;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e6ebef;
    --bg: #eef3f6;
    --card: #ffffff;
    --ok: #16a34a;
    --ok-bg: #dcfce7;
    --warn: #f97316;
    --warn-bg: #ffedd5;
    --danger: #dc2626;
    --danger-bg: #fee2e2;
    --radius: 16px;
    --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px rgba(15, 23, 42, .06);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--ink);
    background: radial-gradient(1200px 420px at 50% -120px, #d4f1f0 0%, rgba(212, 241, 240, 0) 70%), var(--bg);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 720px; margin: 0 auto; padding: 20px 16px calc(40px + env(safe-area-inset-bottom)); }
.head { text-align: center; padding: 8px 0 18px; }
.head h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.02em; }
.subtitle { margin: 6px 0 0; color: var(--muted); font-size: .95rem; }
.flash { border-radius: 12px; padding: 11px 14px; margin-bottom: 14px; font-size: .92rem; font-weight: 600; }
.flash--success { background: var(--ok-bg); color: #166534; }
.flash--error { background: var(--danger-bg); color: #991b1b; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.stat { background: var(--card); border-radius: var(--radius); padding: 14px 12px; text-align: center; box-shadow: var(--shadow); }
.stat__label { display: block; font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.stat__value { display: block; margin-top: 4px; font-size: 1.1rem; font-weight: 800; letter-spacing: -.01em; }
.stat__value--ok { color: var(--ok); }
.stat__value--warn { color: var(--warn); }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); }
.card h2 { margin: 0 0 14px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.count { font-size: .8rem; background: #eef2f5; color: var(--muted); border-radius: 999px; padding: 1px 9px; font-weight: 700; }
.empty { color: var(--muted); margin: 4px 0; }
.hint { color: var(--muted); font-size: .84rem; margin: 12px 0 0; }
.progress-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.progress-head h2 { margin-bottom: 10px; }
.progress-head strong { color: var(--teal-dark); }
.progress { height: 12px; border-radius: 999px; overflow: hidden; background: #e2e8ed; }
.progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), #22c55e); border-radius: inherit; transition: width .18s ease; }
.avatar { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: .9rem; overflow: hidden; }
.avatar--img { background: #e2e8ed; }
.avatar--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar--all { background: var(--ok); }
.owner-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.owner-card { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: linear-gradient(0deg, #f8fafb, #fff); }
.owner-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.owner-card__head div { min-width: 0; display: flex; flex-direction: column; }
.owner-card__head span { color: var(--muted); font-size: .8rem; }
.mini-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mini-list li { display: flex; gap: 7px; align-items: flex-start; color: #334155; font-size: .86rem; }
.mini-list li span { color: var(--teal); font-weight: 800; }
.mini-list li.is-done { color: var(--muted); text-decoration: line-through; }
.category-block + .category-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.category-block h3 { margin: 0 0 10px; font-size: .88rem; color: #334155; text-transform: uppercase; letter-spacing: .04em; }
.packlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.packitem { position: relative; border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 12px; }
.packitem--done { background: #f0fdf4; border-color: #bbf7d0; }
.packform { display: flex; flex-direction: column; gap: 10px; padding-right: 38px; }
.checkline { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checkline input[type="checkbox"] { position: absolute; opacity: 0; pointer-events: none; }
.checkline__box { width: 25px; height: 25px; border-radius: 8px; border: 2px solid #cbd5df; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; }
.checkline input[type="checkbox"]:checked + .checkline__box { background: var(--ok); border-color: var(--ok); }
.checkline input[type="checkbox"]:checked + .checkline__box::after { content: "✓"; color: #fff; font-weight: 900; }
.checkline__title { min-width: 0; flex: 1; }
.checkline__title input { border: 0; padding: 0; width: 100%; color: var(--ink); font: inherit; font-weight: 800; background: transparent; outline: 0; }
.packitem--done .checkline__title input { color: var(--muted); text-decoration: line-through; }
.packform__grid, .row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span { font-size: .82rem; font-weight: 700; color: #334155; }
.field--small > span { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.field input, .field select { font: inherit; padding: 11px 12px; border: 1px solid #d6dde3; border-radius: 11px; background: #fff; color: var(--ink); width: 100%; appearance: none; -webkit-appearance: none; }
.field--small input, .field--small select { padding: 9px 10px; font-size: .9rem; }
.field input:focus, .field select:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(14, 165, 164, .15); }
.field select { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2364748b' d='M1 1l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 34px; }
.packform__actions, .form__actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn { font: inherit; font-weight: 800; border: 0; border-radius: 11px; padding: 11px 16px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; transition: transform .04s ease, background .15s; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-dark); }
.owner-pill { margin-left: auto; display: inline-flex; align-items: center; gap: 7px; font-size: .86rem; color: #334155; background: #eef2f5; border-radius: 999px; padding: 4px 10px 4px 5px; font-weight: 700; }
.owner-pill .avatar { width: 24px; height: 24px; font-size: .72rem; }
.delete-form { position: absolute; right: 12px; top: 12px; margin: 0; }
.iconbtn { border: 0; background: #f1f5f8; cursor: pointer; width: 32px; height: 32px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; text-decoration: none; line-height: 1; }
.iconbtn:hover { background: #e2e8ed; }
.iconbtn--danger:hover { background: var(--danger-bg); color: var(--danger); }
.form { display: flex; flex-direction: column; gap: 14px; }
.people { list-style: none; margin: 0 0 4px; padding: 0; }
.person { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.person:last-child { border-bottom: 0; }
.person strong { flex: 1; }
.details summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; align-items: center; gap: 8px; }
.details summary::-webkit-details-marker { display: none; }
.details summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform .15s; }
.details[open] summary::after { transform: rotate(180deg); }
.details[open] summary { margin-bottom: 14px; }
.foot { text-align: center; color: var(--muted); font-size: .78rem; padding: 8px 0 0; }
@media (max-width: 620px) {
    .owner-grid { grid-template-columns: 1fr; }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
    .wrap { padding-left: 12px; padding-right: 12px; }
    .card { padding: 15px; }
    .packform__grid, .row { grid-template-columns: 1fr; }
    .owner-pill { margin-left: 0; }
}
