* { box-sizing: border-box; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: #0f172a;
    color: #e2e8f0;
    margin: 0;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.wrap {
    max-width: 480px;
    width: 100%;
    padding: 32px;
    text-align: center;
}
h1 { font-size: 1.6rem; margin-bottom: 4px; word-break: break-all; }
.subtitle { color: #94a3b8; margin-bottom: 24px; }
.form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
input, button {
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #334155;
    font-size: 1rem;
}
input {
    background: #1e293b;
    color: #e2e8f0;
}
button {
    background: #3b82f6;
    color: white;
    border: none;
    cursor: pointer;
    font-weight: 600;
}
button:hover { background: #2563eb; }
.error {
    margin-top: 16px;
    padding: 10px;
    background: #7f1d1d;
    border-radius: 8px;
    color: #fecaca;
}
.result {
    margin-top: 20px;
    padding: 14px;
    background: #14532d;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    word-break: break-all;
}
.result a { color: #bbf7d0; font-weight: 600; }
.api-hint {
    margin-top: 32px;
    text-align: left;
    color: #94a3b8;
    font-size: 0.85rem;
}
.api-hint code {
    display: block;
    background: #1e293b;
    padding: 10px;
    border-radius: 6px;
    overflow-x: auto;
    color: #cbd5e1;
}

/* ---- страница со списком ссылок ---- */
.wrap.wide {
    max-width: 900px;
    text-align: left;
}
.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 8px;
}
.topbar h1 { margin: 0; font-size: 1.4rem; }
.topbar-links a {
    color: #93c5fd;
    text-decoration: none;
    margin-left: 16px;
    font-size: 0.9rem;
}
.topbar-links a:hover { text-decoration: underline; }
.links-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}
.links-table th, .links-table td {
    padding: 10px 8px;
    border-bottom: 1px solid #1e293b;
    text-align: left;
}
.links-table th {
    color: #94a3b8;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}
.links-table .target-url {
    max-width: 320px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #cbd5e1;
}
.delete-btn {
    background: #7f1d1d;
    color: #fecaca;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
}
.delete-btn:hover { background: #991b1b; }
.empty { color: #94a3b8; }
