@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,650;9..144,750&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
    --app-bg: #0B0D10;
    --app-bg-2: #111418;
    --panel: rgba(19,22,27,0.92);
    --panel-2: rgba(22,26,32,0.92);
    --panel-3: #101318;
    --line: #2A3039;
    --line-soft: rgba(255,255,255,0.08);
    --text: #F7F2E9;
    --text-soft: #C7C5C0;
    --text-muted: #8E9299;
    --paper: #F4EDDF;
    --paper-soft: #E8DCC6;
    --ink: #17191C;
    --ink-muted: #555D60;
    --orange: #EF6D3A;
    --orange-2: #FF8063;
    --amber: #D6812E;
    --green: #3DCC91;
    --green-soft: #7CE0B4;
    --focus: rgba(61,204,145,0.22);
    --radius: 8px;
    --radius-sm: 6px;
    --shadow: 0 24px 70px rgba(0,0,0,0.35);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 28% -8%, rgba(255,255,255,0.045), transparent 22rem),
        radial-gradient(circle at 70% 0%, rgba(239,109,58,0.045), transparent 24rem),
        linear-gradient(180deg, var(--app-bg-2), var(--app-bg) 34rem);
    color: var(--text);
    font-family: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.5;
}

a {
    color: var(--orange-2);
}

/* ---------- Masthead ---------- */
.masthead {
    min-height: 80px;
    padding: 16px clamp(18px, 2.7vw, 46px);
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: clamp(18px, 2.8vw, 38px);
    border-bottom: 1px solid var(--line);
    background: rgba(8,10,13,0.72);
    backdrop-filter: blur(16px);
}

.brand-lockup {
    color: var(--text);
    text-decoration: none;
}

.wordmark {
    display: block;
    color: var(--text);
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(2.35rem, 3.1vw, 3.45rem);
    font-weight: 650;
    letter-spacing: 0;
    line-height: 0.9;
}

.wordmark span {
    color: var(--orange);
}

.tagline {
    justify-self: start;
    color: var(--text-muted);
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(0.95rem, 1.1vw, 1.14rem);
    font-style: italic;
    white-space: nowrap;
}

.masthead-actions {
    grid-column: 3;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
}

.masthead-divider {
    width: 1px;
    height: 32px;
    background: var(--line);
}

.language-switcher {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: rgba(9,11,14,0.35);
}

.language-switcher::before {
    content: "\25CE";
    margin: 0 5px 0 4px;
    color: var(--text);
    font-size: 1rem;
}

.language-switcher a {
    min-width: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 8px;
    border-radius: 4px;
    color: var(--text-muted);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.78rem;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
}

.language-switcher a.active {
    background: rgba(255,255,255,0.08);
    color: var(--text);
}

.language-switcher a.active::after {
    content: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: 0.96rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
    color: var(--orange-2);
}

.nav-link-icon span {
    color: inherit;
    font-size: 1.1rem;
}

.icon-link {
    width: 38px;
    height: 38px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    color: var(--text);
    text-decoration: none;
}

/* ---------- Main workspace ---------- */
.stage {
    min-height: calc(100vh - 80px);
    padding: 16px clamp(18px, 2.7vw, 46px) 36px;
    display: grid;
    grid-template-columns: minmax(286px, 0.76fr) minmax(430px, 1.08fr) minmax(540px, 1.42fr);
    gap: 16px;
    align-items: stretch;
}

.side-links-panel,
.creator-panel,
.preview-panel,
.danger-panel,
.setup-panel,
.empty-state,
.link-row {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
        var(--panel);
    box-shadow: var(--shadow);
}

.workspace-nav,
.card-stage {
    position: sticky;
    top: 16px;
}

.side-links-panel,
.creator-panel,
.preview-panel {
    min-height: calc(100vh - 132px);
}

.creator-panel,
.preview-panel {
    padding: clamp(22px, 2.4vw, 34px);
}

.creator-panel {
    display: flex;
    flex-direction: column;
}

.creator-panel h1.headline,
.preview-heading h2,
.side-links-heading h2 {
    margin: 0;
    color: var(--text);
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 650;
    letter-spacing: 0;
    line-height: 1.05;
}

h1.headline {
    margin: 0 0 6px;
    font-size: clamp(1.9rem, 2.4vw, 2.55rem);
}

.lede {
    margin: 0 0 26px;
    color: var(--text-soft);
    font-size: 1rem;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--orange);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
}

/* ---------- Recent links ---------- */
.side-links-panel {
    padding: 20px;
    overflow: hidden;
}

.side-links-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 12px;
}

.side-links-heading h2 {
    font-size: clamp(1.55rem, 1.7vw, 1.9rem);
}

.side-add {
    width: 40px;
    height: 40px;
    display: inline-grid;
    place-items: center;
    border: 1px solid #3A404B;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-size: 1.6rem;
    line-height: 1;
    text-decoration: none;
}

.side-add:hover {
    border-color: var(--orange);
    color: var(--orange-2);
}

.side-search {
    height: 42px;
    position: relative;
    display: block;
    margin-bottom: 16px;
    border: 1px solid #343A44;
    border-radius: var(--radius-sm);
    background: rgba(9,11,14,0.35);
}

.side-search input[type="search"] {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    padding-right: 42px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--text);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 0.92rem;
}

.side-search input:focus {
    box-shadow: none;
}

.side-search span {
    position: absolute;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1;
    pointer-events: none;
}

.side-empty {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.side-link-list {
    display: grid;
    max-height: calc(100vh - 290px);
    overflow: auto;
}

.side-link-item {
    width: 100%;
    min-height: 86px;
    display: grid;
    grid-template-columns: 106px minmax(0, 1fr) 22px;
    grid-template-rows: auto auto;
    column-gap: 16px;
    align-items: center;
    padding: 10px 2px;
    border: 0;
    border-bottom: 1px solid rgba(255,255,255,0.07);
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.side-link-item:hover,
.side-link-item.active {
    background: rgba(255,255,255,0.025);
}

.side-link-thumb {
    width: 106px;
    aspect-ratio: 1200 / 630;
    grid-row: 1 / 3;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    background:
        linear-gradient(135deg, rgba(214,129,46,0.24), transparent 52%),
        #222832;
    background-position: center;
    background-size: cover;
}

.side-link-title,
.side-link-url {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.side-link-title {
    align-self: end;
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
}

.side-link-url {
    align-self: start;
    color: var(--orange);
    font-size: 0.88rem;
    font-weight: 700;
}

.side-link-menu {
    grid-column: 3;
    grid-row: 1 / 3;
    align-self: start;
    color: var(--text-soft);
    font-weight: 700;
    letter-spacing: 0.08em;
}

.side-open-all {
    min-height: 58px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    border: 1px solid #343A44;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 1rem;
    text-decoration: none;
}

.side-open-all:hover {
    border-color: var(--orange);
    color: var(--text);
}

/* ---------- Form ---------- */
.field {
    margin-bottom: 22px;
}

.field label {
    display: block;
    margin-bottom: 3px;
    color: var(--text);
    font-size: 1rem;
    font-weight: 700;
}

.label-note {
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
}

.field-help,
.hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.field-help {
    margin-bottom: 8px;
}

.hint {
    margin-top: 8px;
    font-size: 0.82rem;
}

input[type="url"],
input[type="email"],
input[type="text"],
input[type="password"],
input[type="search"],
select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid #3A404B;
    border-radius: var(--radius-sm);
    background: rgba(9,11,14,0.34);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.92rem;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

input[type="url"]::placeholder,
input[type="email"]::placeholder,
input[type="text"]::placeholder,
input[type="password"]::placeholder,
input[type="search"]::placeholder {
    color: #777C84;
}

select {
    appearance: none;
    background:
        linear-gradient(45deg, transparent 50%, var(--text-soft) 50%),
        linear-gradient(135deg, var(--text-soft) 50%, transparent 50%),
        rgba(9,11,14,0.34);
    background-position:
        calc(100% - 18px) 21px,
        calc(100% - 12px) 21px,
        0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;
}

input[readonly] {
    color: var(--text-soft);
    opacity: 1;
}

input:focus {
    outline: none;
    border-color: var(--green);
    background: rgba(7,9,12,0.46);
    box-shadow: 0 0 0 3px var(--focus);
}

select:focus {
    outline: none;
    border-color: var(--green);
    box-shadow: 0 0 0 3px var(--focus);
}

.slug-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
}

.slug-prefix {
    min-height: 48px;
    max-width: 180px;
    padding: 12px 16px;
    overflow: hidden;
    border: 1px solid #3A404B;
    border-right: 0;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
    background: rgba(255,255,255,0.03);
    color: var(--text);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.88rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.slug-row input {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.file-drop {
    min-height: 106px;
    padding: 22px;
    display: grid;
    place-items: center;
    position: relative;
    border: 1px dashed #6C727B;
    border-radius: var(--radius-sm);
    background: rgba(7,9,12,0.16);
    color: var(--text-soft);
    cursor: pointer;
    text-align: center;
}

.file-drop:hover,
.file-drop.has-file {
    border-color: var(--orange);
    color: var(--text);
}

.upload-icon {
    width: 44px;
    height: 36px;
    display: grid;
    place-items: center;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 2rem;
    line-height: 1;
}

#file-drop-text {
    font-size: 1.05rem;
}

.file-drop-subtext {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.file-drop input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.selected-file {
    min-height: 70px;
    margin-top: 16px;
    padding: 10px;
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) auto;
    align-items: center;
    gap: 14px;
    border: 1px solid #303640;
    border-radius: var(--radius-sm);
    background: rgba(255,255,255,0.035);
}

.selected-file[hidden] {
    display: none;
}

.selected-file-thumb {
    width: 86px;
    aspect-ratio: 1200 / 630;
    border-radius: 5px;
    background:
        linear-gradient(135deg, rgba(214,129,46,0.25), transparent 54%),
        #222832;
    background-position: center;
    background-size: cover;
}

.selected-file strong,
.selected-file small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.selected-file strong {
    color: var(--text);
    font-size: 0.92rem;
}

.selected-file small {
    color: var(--text-muted);
}

.selected-file-action {
    padding: 9px 12px;
    border: 1px solid #3A404B;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-size: 0.9rem;
}

/* ---------- Buttons ---------- */
.btn {
    appearance: none;
    min-height: 56px;
    padding: 14px 20px;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn[disabled] {
    cursor: not-allowed;
    opacity: 0.55;
}

.btn-primary {
    background: linear-gradient(180deg, var(--orange-2), #EF6641);
    color: #FFF7F1;
}

.btn-primary:hover {
    background: linear-gradient(180deg, #FF8F75, #F56F4B);
}

.btn-secondary {
    background: rgba(7,9,12,0.16);
    border-color: var(--orange);
    color: var(--text);
}

.btn-secondary:hover {
    border-color: var(--orange-2);
    background: rgba(239,109,58,0.1);
}

.btn-danger {
    background: var(--orange);
    color: #FFF7F1;
}

.btn-block {
    width: 100%;
    margin-bottom: 14px;
}

.form-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 26px;
}

.form-actions .btn {
    width: 100%;
}

#preview-btn::before {
    content: "\2726";
    margin-right: 10px;
    color: var(--orange-2);
}

#submit-btn::before {
    content: "\1F517";
    margin-right: 10px;
}

.ready-note {
    margin: 24px 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

.ready-note span {
    width: 22px;
    height: 22px;
    display: inline-grid;
    place-items: center;
    border: 1px solid var(--green);
    border-radius: 50%;
    color: var(--green);
    font-size: 0.82rem;
}

/* ---------- Preview ---------- */
.card-stage {
    align-self: stretch;
}

.preview-panel {
    display: flex;
    flex-direction: column;
}

.preview-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.preview-heading h2 {
    font-size: clamp(1.55rem, 1.7vw, 1.9rem);
}

.preview-ratio {
    padding: 7px 12px;
    border: 1px solid #343A44;
    border-radius: var(--radius-sm);
    color: var(--text-soft);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.86rem;
}

.cover-card {
    overflow: hidden;
    border-radius: 14px;
    background: var(--paper);
    box-shadow: 0 20px 55px rgba(0,0,0,0.4);
}

.cover-image {
    width: 100%;
    aspect-ratio: 1200 / 630;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.38), rgba(214,129,46,0.18)),
        url('../uploads/default-cover-it.svg');
    background-position: center;
    background-size: cover;
    color: rgba(23,25,28,0.42);
    font-weight: 700;
}

.cover-body {
    padding: clamp(18px, 2.2vw, 28px);
    background: var(--paper);
    color: var(--ink);
}

.cover-domain {
    margin: 0 0 6px;
    color: #25846F;
    font-size: 0.95rem;
    font-weight: 600;
}

.cover-title {
    margin: 0 0 5px;
    color: var(--ink);
    font-family: 'Fraunces', Georgia, serif;
    font-size: clamp(1.35rem, 1.9vw, 2rem);
    font-weight: 750;
    line-height: 1.1;
}

.cover-desc {
    margin: 0;
    color: var(--ink-muted);
    display: -webkit-box;
    overflow: hidden;
    font-size: 0.98rem;
    font-weight: 600;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.share-panel {
    margin-top: 18px;
    padding: 20px;
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.015)),
        rgba(16,19,24,0.76);
}

.share-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 8px;
}

.share-heading h3 {
    margin: 0;
    color: var(--text);
    font-size: 1.02rem;
}

.share-icons {
    display: flex;
    align-items: center;
    gap: clamp(14px, 2vw, 28px);
    color: var(--text-soft);
    font-weight: 700;
}

.share-panel > p {
    max-width: 66ch;
    margin: 0 0 16px;
    color: var(--text-muted);
    font-size: 0.92rem;
}

.ready-card {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px;
    border: 1px solid #343A44;
    border-radius: var(--radius-sm);
    background: rgba(8,10,13,0.24);
}

.ready-card > span {
    width: 22px;
    height: 22px;
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    border: 1px solid var(--green);
    border-radius: 50%;
    color: var(--green);
    font-size: 0.82rem;
}

.ready-card strong {
    display: block;
    color: var(--green-soft);
    font-size: 0.95rem;
}

.ready-card p {
    margin: 2px 0 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ---------- Result and status ---------- */
.result {
    display: none;
    margin-top: 20px;
    padding: 16px;
    border: 1px solid rgba(61,204,145,0.42);
    border-radius: var(--radius-sm);
    background: rgba(61,204,145,0.08);
}

.result.show {
    display: block;
}

.result-label {
    margin: 0 0 10px;
    color: var(--green-soft);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.result-link-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
}

.result-link {
    min-height: 46px;
    padding: 13px 14px;
    overflow-x: auto;
    border-radius: var(--radius-sm);
    background: rgba(7,9,12,0.4);
    color: var(--orange-2);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.86rem;
    white-space: nowrap;
}

.status-msg {
    display: none;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.86rem;
}

.status-msg.error {
    display: block;
    border: 1px solid rgba(239,109,58,0.7);
    background: rgba(239,109,58,0.12);
    color: #FFD0C5;
}

.status-msg.success {
    display: block;
    border: 1px solid rgba(61,204,145,0.34);
    background: rgba(61,204,145,0.1);
    color: #BAF2D9;
}

.status-msg.loading {
    display: block;
    border: 1px solid rgba(61,204,145,0.28);
    background: rgba(61,204,145,0.07);
    color: var(--text-soft);
    font-style: italic;
}

/* ---------- Auth, settings and archive pages ---------- */
.setup-shell,
.settings-shell,
.links-shell {
    max-width: 1020px;
    margin: 0 auto;
    padding: clamp(34px, 5vw, 64px) clamp(18px, 4vw, 56px) 86px;
}

.links-shell {
    max-width: 1360px;
}

.setup-panel {
    max-width: 620px;
    margin: 0 auto;
    padding: clamp(22px, 4vw, 34px);
    border-radius: var(--radius);
}

.setup-errors {
    margin: 0 0 20px;
}

.setup-errors p {
    margin: 0;
}

.setup-errors p + p {
    margin-top: 6px;
}

.setup-form {
    margin-top: 22px;
}

.setup-form-section {
    margin: 26px 0 18px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.setup-form-section h2 {
    margin: 0 0 8px;
    font-size: 1rem;
}

.setup-form-section p {
    margin: 0;
    color: var(--text-soft);
    font-size: 0.9rem;
}

.config-help {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.config-help h2 {
    margin: 0 0 10px;
    font-size: 1rem;
}

.config-help p {
    margin: 0 0 14px;
    color: var(--text-soft);
}

.config-help code {
    font-family: 'IBM Plex Mono', monospace;
}

.config-help pre {
    max-width: 100%;
    margin: 0 0 14px;
    padding: 14px;
    overflow-x: auto;
    border: 1px solid #343A44;
    border-radius: var(--radius-sm);
    background: rgba(7,9,12,0.58);
    color: var(--orange-2);
    font-size: 0.82rem;
    line-height: 1.55;
}

.setup-link,
.links-create {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.settings-heading,
.links-heading {
    margin-bottom: 28px;
}

.danger-panel {
    padding: 20px;
    border-color: rgba(239,109,58,0.62);
}

.settings-panel {
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background:
        linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.012)),
        var(--panel);
}

.danger-panel h2,
.settings-panel h2,
.empty-state h2,
.link-main h2 {
    font-family: 'Fraunces', Georgia, serif;
}

.danger-panel h2,
.settings-panel h2 {
    margin: 0 0 8px;
    font-size: 1.34rem;
}

.settings-panel p,
.danger-panel p,
.empty-state p {
    margin: 0 0 20px;
    color: var(--text-soft);
}

.settings-facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
}

.settings-facts div,
.user-row {
    padding: 12px;
    border: 1px solid #343A44;
    border-radius: var(--radius-sm);
    background: rgba(8,10,13,0.22);
}

.settings-facts dt {
    color: var(--text-muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.settings-facts dd {
    margin: 4px 0 0;
    color: var(--text);
    overflow-wrap: anywhere;
}

.user-list {
    display: grid;
    gap: 10px;
}

.settings-form {
    display: grid;
    gap: 16px;
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.settings-form h3 {
    margin: 0;
    font-size: 1rem;
}

.settings-form .setup-errors {
    margin-bottom: 0;
}

.invite-link {
    color: var(--orange-2);
    overflow-wrap: anywhere;
}

.user-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.user-row strong,
.user-row span,
.user-row small {
    display: block;
}

.user-row span,
.user-row small {
    color: var(--text-muted);
}

.links-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
}

.links-create {
    width: auto;
    white-space: nowrap;
}

.links-error {
    display: block;
}

.empty-state {
    padding: 28px;
    border-radius: var(--radius);
}

.empty-state h2 {
    margin: 0 0 8px;
}

.links-list {
    display: grid;
    gap: 12px;
}

.link-row {
    display: grid;
    grid-template-columns: 112px minmax(0, 1fr) auto auto;
    gap: 18px;
    align-items: center;
    padding: 14px;
    border-radius: var(--radius);
}

.link-thumb {
    width: 112px;
    aspect-ratio: 1200 / 630;
    border-radius: var(--radius-sm);
    background:
        linear-gradient(135deg, rgba(214,129,46,0.24), transparent 52%),
        #222832;
    background-position: center;
    background-size: cover;
}

.link-kicker {
    margin: 0 0 3px;
    color: var(--orange);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.link-main h2 {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 1.1rem;
    line-height: 1.2;
}

.link-destination,
.link-short {
    display: block;
    max-width: 58ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.link-destination {
    margin: 0 0 4px;
    color: var(--text-muted);
    font-size: 0.84rem;
}

.link-short {
    color: var(--orange-2);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.82rem;
}

.link-meta {
    display: grid;
    gap: 5px;
    color: var(--text-muted);
    font-size: 0.78rem;
    white-space: nowrap;
}

.link-meta strong {
    color: var(--text);
}

.link-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.link-actions .btn {
    min-height: 40px;
    padding: 9px 13px;
    text-decoration: none;
}

footer.site-footer {
    padding: 28px 24px;
    border-top: 1px solid var(--line);
    color: var(--text-muted);
    font-size: 0.78rem;
    text-align: center;
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--orange-2);
    outline-offset: 3px;
}

@media (max-width: 1260px) {
    .stage {
        grid-template-columns: minmax(276px, 0.78fr) minmax(410px, 1fr);
    }

    .card-stage {
        grid-column: 2;
        position: static;
    }

    .preview-panel {
        min-height: auto;
    }
}

@media (max-width: 900px) {
    .masthead {
        grid-template-columns: 1fr;
        align-items: start;
    }

    .tagline {
        display: none;
    }

    .masthead-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }

    .stage {
        grid-template-columns: 1fr;
    }

    .workspace-nav,
    .card-stage {
        position: static;
        grid-column: auto;
    }

    .side-links-panel,
    .creator-panel,
    .preview-panel {
        min-height: auto;
    }

    .side-link-list {
        max-height: 360px;
    }

    .links-heading {
        display: block;
    }

    .links-create {
        margin-top: 14px;
    }

    .link-row {
        grid-template-columns: 112px minmax(0, 1fr);
    }

    .link-meta,
    .link-actions {
        grid-column: 2;
    }
}

@media (max-width: 620px) {
    .masthead,
    .stage,
    .setup-shell,
    .settings-shell,
    .links-shell {
        padding-inline: 14px;
    }

    .wordmark {
        font-size: 2.45rem;
    }

    .masthead-divider {
        display: none;
    }

    .form-actions,
    .result-link-row,
    .selected-file,
    .settings-facts {
        grid-template-columns: 1fr;
    }

    .user-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .side-link-item {
        grid-template-columns: 88px minmax(0, 1fr) 18px;
    }

    .side-link-thumb {
        width: 88px;
    }

    .slug-row {
        grid-template-columns: 1fr;
    }

    .slug-prefix {
        max-width: none;
        border-right: 1px solid #3A404B;
        border-bottom: 0;
        border-radius: var(--radius-sm) var(--radius-sm) 0 0;
    }

    .slug-row input {
        border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    }

    .preview-heading,
    .share-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .link-row {
        grid-template-columns: 1fr;
    }

    .link-thumb {
        width: 100%;
    }

    .link-meta,
    .link-actions {
        grid-column: auto;
    }

    .link-actions {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
