:root {
    --ink: #1c1c1e;
    --muted: #6b6b70;
    --line: #e2e2e5;
    --accent: #2f6fed;
    --danger: #d84343;
    --bg: #f7f7f8;
}
* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--ink);
}
.wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px 80px;
}
.wrap.narrow {
    max-width: 380px;
    padding-top: 80px;
}
h1 { font-size: 1.5rem; margin: 0 0 8px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }
.logout { color: var(--muted); font-size: 0.9rem; text-decoration: none; }
.logout:hover { color: var(--ink); }
.muted { color: var(--muted); font-size: 0.9rem; }
.error { background: #fdecec; color: var(--danger); padding: 10px 14px; border-radius: 8px; font-size: 0.9rem; }
.success { background: #eaf6ec; color: #23843b; padding: 10px 14px; border-radius: 8px; font-size: 0.9rem; }

form label {
    display: block;
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 14px;
}
form input[type=text],
form input[type=url],
form input[type=password] {
    display: block;
    width: 100%;
    margin-top: 6px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 1rem;
    color: var(--ink);
}
button {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
}
button:hover { opacity: 0.9; }
button.danger { background: transparent; color: var(--danger); padding: 4px 8px; font-size: 0.85rem; }

.password-panel { margin-bottom: 20px; }
.password-panel summary { color: var(--muted); font-size: 0.9rem; cursor: pointer; }
.password-panel form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-top: 12px;
    max-width: 380px;
}

.create-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 28px;
    display: flex;
    gap: 16px;
    align-items: flex-end;
    flex-wrap: wrap;
}
.create-form label { flex: 1; min-width: 220px; margin-bottom: 0; }

table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 12px; overflow: hidden; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 0.9rem; }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; }
td.target { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr:last-child td { border-bottom: none; }
td.actions { white-space: nowrap; }
td.actions form { display: inline; }

button.link-button { background: transparent; color: var(--accent); padding: 4px 8px; font-size: 0.85rem; }
button.secondary { background: transparent; color: var(--muted); border: 1px solid var(--line); }

#qr-dialog { border: none; border-radius: 12px; padding: 0; max-width: calc(100vw - 32px); }
#qr-dialog::backdrop { background: rgba(0, 0, 0, 0.4); }
.qr-box { padding: 24px; text-align: center; }
#qr-image svg { display: block; width: 260px; height: 260px; max-width: 100%; margin: 0 auto; }
#qr-url { word-break: break-all; margin: 12px 0 16px; }
.qr-buttons { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
