:root {
    --bg: #f6f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #61708a;
    --line: #dfe5ef;
    --accent: #176b5f;
    --accent-strong: #11554b;
    --danger: #a92d35;
    --danger-bg: #fff0f1;
    --success: #176b3d;
    --success-bg: #edf8f1;
    --shadow: 0 24px 70px rgba(23, 32, 51, .12);
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

.login-shell {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 24px;
}

.login-panel {
    width: min(100%, 460px);
    padding: 36px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.brand-mark,
.app-logo span {
    display: grid;
    width: 46px;
    height: 46px;
    place-items: center;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
}

.eyebrow {
    margin: 22px 0 8px;
    color: var(--accent);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 12px;
    font-size: clamp(2rem, 7vw, 3.1rem);
    line-height: 1.02;
}

.login-copy {
    margin-bottom: 24px;
    color: var(--muted);
    line-height: 1.55;
}

.google-button,
.primary-button,
.ghost-link {
    min-height: 46px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
}

.google-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--line);
    background: #fff;
}

.google-icon {
    display: grid;
    width: 24px;
    height: 24px;
}

.google-icon svg {
    width: 100%;
    height: 100%;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px clamp(16px, 4vw, 42px);
    background: rgba(255, 255, 255, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.app-logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    text-decoration: none;
}

.app-logo span {
    width: 38px;
    height: 38px;
    font-size: .8rem;
}

.user-area {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    color: var(--muted);
    font-weight: 700;
}

.avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
}

.ghost-link {
    display: inline-grid;
    min-height: 38px;
    place-items: center;
    padding: 0 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.dashboard {
    width: min(1120px, 100%);
    margin: 0 auto;
    padding: 36px clamp(16px, 4vw, 42px) 64px;
}

.dashboard-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 20px;
}

.dashboard-head .eyebrow {
    margin-top: 0;
}

.dashboard-head h1 {
    margin-bottom: 0;
}

.primary-button {
    display: inline-grid;
    place-items: center;
    padding: 0 18px;
    border: 0;
    background: var(--accent);
    color: #fff;
    cursor: pointer;
}

.primary-button:hover {
    background: var(--accent-strong);
}

.primary-button:disabled {
    cursor: wait;
    opacity: .72;
}

.primary-button.full {
    width: 100%;
}

.alert {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 700;
}

.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
}

.alert-success {
    background: var(--success-bg);
    color: var(--success);
}

.alert[hidden],
[hidden] {
    display: none !important;
}

.empty-state {
    padding: 34px;
    background: var(--panel);
    border: 1px dashed #bdc8d8;
    border-radius: 8px;
    color: var(--muted);
}

.empty-state h2 {
    margin-bottom: 8px;
    color: var(--ink);
}

.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
    gap: 16px;
}

.link-card {
    display: flex;
    min-height: 210px;
    flex-direction: column;
    justify-content: space-between;
    gap: 20px;
    padding: 22px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.link-card h2 {
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.link-card p {
    color: var(--muted);
    line-height: 1.55;
}

.link-card a {
    overflow-wrap: anywhere;
    color: var(--accent);
    font-weight: 800;
}

.modal {
    width: min(94vw, 520px);
    padding: 0;
    border: 0;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.modal::backdrop {
    background: rgba(23, 32, 51, .55);
}

.modal-form {
    display: grid;
    gap: 16px;
    padding: 24px;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.modal-head h2 {
    margin-bottom: 0;
}

.icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    color: var(--ink);
    cursor: pointer;
    font-size: 1.6rem;
    line-height: 1;
}

label {
    display: grid;
    gap: 8px;
    color: var(--muted);
    font-weight: 800;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 13px 14px;
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(23, 107, 95, .14);
}

@media (max-width: 680px) {
    .login-panel {
        padding: 26px;
    }

    .topbar,
    .dashboard-head {
        align-items: stretch;
        flex-direction: column;
    }

    .user-area {
        flex-wrap: wrap;
    }

    .primary-button {
        width: 100%;
    }
}
