:root {
    --bg: #f6efe3;
    --bg-accent: #e7d8bf;
    --card: rgba(255, 252, 247, 0.92);
    --border: rgba(72, 49, 33, 0.12);
    --text: #2f241c;
    --muted: #715c4a;
    --accent: #0c7a5d;
    --accent-strong: #095f49;
    --danger: #9b2c2c;
    --shadow: 0 24px 60px rgba(58, 35, 15, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.7), transparent 30%),
        linear-gradient(145deg, var(--bg), var(--bg-accent));
}

.page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem;
}

.card {
    width: min(100%, 42rem);
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 24px;
    box-shadow: var(--shadow);
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.card-wide {
    width: min(100%, 72rem);
}

.eyebrow {
    margin: 0 0 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--accent);
    font-size: 0.78rem;
    font-weight: 700;
}

h1 {
    margin: 0;
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 0.95;
}

.intro {
    margin: 1rem 0 0;
    max-width: 36rem;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.6;
}

.form {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
}

.field {
    display: grid;
    gap: 0.45rem;
    font-weight: 700;
}

.field span {
    font-size: 0.95rem;
}

.field small {
    color: var(--muted);
    font-weight: 400;
}

input {
    width: 100%;
    border: 1px solid rgba(72, 49, 33, 0.18);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text);
    padding: 0.95rem 1rem;
    font: inherit;
}

input:focus {
    outline: 2px solid rgba(12, 122, 93, 0.16);
    border-color: rgba(12, 122, 93, 0.6);
}

.slug-input {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.65rem;
}

.slug-prefix {
    color: var(--muted);
    font-size: 0.95rem;
    word-break: break-all;
}

button {
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    color: #fff;
    padding: 1rem 1.4rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 140ms ease, box-shadow 140ms ease;
    box-shadow: 0 16px 30px rgba(12, 122, 93, 0.24);
}

button:hover {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.65;
    cursor: wait;
    transform: none;
}

.result {
    margin-top: 1.75rem;
    padding: 1rem 1.1rem;
    border-radius: 18px;
    background: rgba(12, 122, 93, 0.08);
    border: 1px solid rgba(12, 122, 93, 0.14);
}

.result-label {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.result-copy {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
    margin-top: 0.6rem;
}

.result-input {
    color: var(--accent-strong);
    font-size: 1rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.72);
}

.copy-button {
    padding: 0.85rem 1.1rem;
    box-shadow: 0 12px 24px rgba(12, 122, 93, 0.16);
}

.result-target,
.message,
.secondary-link {
    color: var(--muted);
}

.result-target,
.message {
    margin: 0.6rem 0 0;
    line-height: 1.5;
}

.message[data-state="error"] {
    color: var(--danger);
}

.secondary-link {
    display: inline-block;
    margin-top: 1.25rem;
}

.admin-header,
.panel-header {
    display: grid;
    gap: 1rem;
}

.admin-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
    align-items: center;
}

.admin-title {
    font-size: clamp(2rem, 4vw, 3.25rem);
}

.admin-panel {
    margin-top: 1.75rem;
    padding: 1.3rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.54);
    border: 1px solid rgba(72, 49, 33, 0.1);
}

.admin-panel h2,
.stat-value {
    margin: 0;
}

.compact,
.compact-note {
    margin: 0.75rem 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.compact-note {
    font-size: 0.95rem;
}

.code-block {
    margin: 1rem 0 0;
    padding: 1rem;
    border-radius: 16px;
    overflow-x: auto;
    background: #2f241c;
    color: #f6efe3;
}

.banner {
    margin-top: 1.5rem;
    padding: 0.95rem 1rem;
    border-radius: 14px;
    background: rgba(12, 122, 93, 0.08);
    border: 1px solid rgba(12, 122, 93, 0.14);
}

.message[data-state="success"] {
    color: var(--accent-strong);
}

.stats-grid {
    display: grid;
    gap: 1rem;
    margin-top: 1.75rem;
}

.stat-card {
    padding: 1.2rem;
    border-radius: 20px;
    background: rgba(12, 122, 93, 0.08);
    border: 1px solid rgba(12, 122, 93, 0.14);
}

.stat-label {
    margin: 0 0 0.45rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.82rem;
}

.stat-value {
    font-size: clamp(1.6rem, 3vw, 2.6rem);
    line-height: 1;
}

.search-form {
    display: grid;
    gap: 0.75rem;
}

.table-wrap {
    margin-top: 1rem;
    overflow-x: auto;
}

.links-table {
    width: 100%;
    border-collapse: collapse;
}

.links-table th,
.links-table td {
    padding: 0.9rem 0.75rem;
    border-bottom: 1px solid rgba(72, 49, 33, 0.12);
    text-align: left;
    vertical-align: top;
}

.links-table th {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
}

.links-table a {
    color: var(--accent-strong);
    text-decoration: none;
}

.url-cell {
    min-width: 22rem;
    word-break: break-word;
}

.danger-button,
.ghost-button {
    border-radius: 999px;
    padding: 0.8rem 1rem;
    box-shadow: none;
}

.danger-button {
    background: linear-gradient(135deg, #a63131, #7f2222);
}

.ghost-button {
    background: rgba(47, 36, 28, 0.08);
    color: var(--text);
    border: 1px solid rgba(72, 49, 33, 0.12);
}

@media (min-width: 700px) {
    .slug-input {
        grid-template-columns: minmax(0, 1fr) 14rem;
        align-items: center;
    }

    .result-copy {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
    }

    .admin-header {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: start;
    }

    .panel-header,
    .search-form,
    .stats-grid {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
