:root {
    --bg: #f5f5f7;
    --panel: #ffffff;
    --text: #111111;
    --muted: #6e6e73;
    --left: #e9e9eb;
    --right: #0a84ff;
    --right-text: #ffffff;
    --shadow: 0 8px 30px rgba(0,0,0,.08);
    --radius: 22px;
    --border: 1px solid rgba(0,0,0,.06);
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: linear-gradient(180deg, #ececf1 0%, #f7f7fa 100%);
    color: var(--text);
}
.flash-wrap {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 16px 0;
}
.flash {
    max-width: 980px;
    margin: 0 auto 8px;
    padding: 12px 14px;
    border-radius: 14px;
    box-shadow: var(--shadow);
    background: white;
}
.flash-error { border-left: 4px solid #d33; }
.flash-success { border-left: 4px solid #2e9d53; }
.landing, .wrap {
    max-width: 1024px;
    margin: 0 auto;
    padding: 24px 16px 40px;
}
.card {
    background: rgba(255,255,255,.8);
    border: var(--border);
    box-shadow: var(--shadow);
    border-radius: 28px;
    padding: 24px;
    margin-bottom: 18px;
}
.hero {
    text-align: center;
    padding: 40px 24px;
}
.eyebrow {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    margin-bottom: 10px;
}
h1, h2 { margin: 0 0 12px; }
.lead {
    max-width: 700px;
    margin: 0 auto 24px;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.55;
}
.upload-form {
    max-width: 640px;
    margin: 0 auto;
    display: grid;
    gap: 14px;
}
.field {
    text-align: left;
    display: grid;
    gap: 8px;
}
.field span { font-size: 14px; color: var(--muted); }
input[type="file"], input[type="text"], select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(0,0,0,.12);
    background: white;
    font-size: 15px;
}
button, .back-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    border: 0;
    background: var(--right);
    color: white;
    padding: 12px 18px;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}
.notes ul {
    margin: 0;
    padding-left: 18px;
    line-height: 1.7;
    color: var(--muted);
}
.recent-list {
    display: grid;
    gap: 10px;
}
.recent-item {
    border: var(--border);
    border-radius: 18px;
    padding: 14px 16px;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.8);
    display: grid;
    gap: 3px;
}
.recent-item span, .recent-item small { color: var(--muted); }
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}
.title { font-size: 28px; }
.subtitle { color: var(--muted); }
.owner-form {
    margin-bottom: 16px;
}
.owner-form label {
    display: grid;
    gap: 8px;
    color: var(--muted);
}
.phone {
    max-width: 760px;
    margin: 0 auto;
    background: rgba(255,255,255,.72);
    border: var(--border);
    box-shadow: var(--shadow);
    border-radius: 32px;
    padding: 20px 14px 28px;
}
.date-sep {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    margin: 18px 0 12px;
}
.row {
    display: flex;
    margin: 6px 0;
}
.row.left { justify-content: flex-start; }
.row.right { justify-content: flex-end; }
.bubble-wrap { max-width: 78%; }
.meta {
    font-size: 11px;
    color: var(--muted);
    margin: 0 12px 4px;
    line-height: 1.35;
}
.row.right .meta { text-align: right; }
.bubble {
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 15px;
    line-height: 1.4;
    white-space: normal;
    word-wrap: break-word;
}
.row.left .bubble {
    background: var(--left);
    color: var(--text);
    border-bottom-left-radius: 8px;
}
.row.right .bubble {
    background: var(--right);
    color: var(--right-text);
    border-bottom-right-radius: 8px;
}
.legend {
    max-width: 760px;
    margin: 0 auto 16px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
}
.pill {
    background: rgba(255,255,255,.72);
    border: var(--border);
    border-radius: 999px;
    padding: 10px 14px;
    text-align: center;
    box-shadow: var(--shadow);
}
.swatch {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    margin-right: 6px;
    vertical-align: -1px;
}
.left-swatch { background: var(--left); border: 1px solid rgba(0,0,0,.12); }
.right-swatch { background: var(--right); }
@media (max-width: 760px) {
    .header { flex-direction: column; align-items: flex-start; }
    .phone { border-radius: 22px; padding: 16px 10px 20px; }
    .bubble-wrap { max-width: 88%; }
    .legend { grid-template-columns: 1fr; }
}
