:root {
    color-scheme: light;
    --bg: #f7f8f5;
    --surface: #ffffff;
    --text: #1d2520;
    --muted: #657168;
    --line: #dce2db;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --danger: #b42318;
    --success: #28724b;
    --info: #315a8c;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

a {
    color: var(--accent-dark);
}

.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: 64px;
    padding: 0 32px;
    border-bottom: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.9);
}

.brand {
    color: var(--text);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.nav-links a,
.primary-action,
.secondary-action,
button {
    border-radius: 8px;
    font: inherit;
    font-weight: 650;
    text-decoration: none;
}

.nav-links a {
    color: var(--muted);
}

.primary-action,
button {
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #ffffff;
}

.page-shell {
    width: min(960px, calc(100% - 32px));
    margin: 48px auto;
}

.panel,
.auth-panel {
    max-width: 680px;
    padding: 32px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(29, 37, 32, 0.08);
}

.auth-panel {
    max-width: 520px;
}

.directory {
    max-width: 760px;
}

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

h1 {
    margin: 0 0 12px;
    font-size: 34px;
    line-height: 1.15;
}

p {
    color: var(--muted);
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.primary-action,
.secondary-action,
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 9px 14px;
    cursor: pointer;
}

.secondary-action {
    border: 1px solid var(--line);
    background: #ffffff;
    color: var(--text);
}

form {
    display: grid;
    gap: 16px;
}

label {
    display: grid;
    gap: 6px;
    color: var(--text);
    font-weight: 650;
}

input {
    min-height: 42px;
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    color: var(--text);
    font: inherit;
    background: #ffffff;
}

.form-note {
    margin-bottom: 0;
}

.app-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 280px));
    gap: 16px;
    justify-content: start;
    margin-top: 28px;
}

.app-tile {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 154px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 14px 32px rgba(29, 37, 32, 0.08);
    transition: border-color 120ms ease, box-shadow 120ms ease, transform 120ms ease;
}

.app-tile:hover,
.app-tile:focus-visible {
    border-color: rgba(15, 118, 110, 0.45);
    box-shadow: 0 18px 40px rgba(29, 37, 32, 0.12);
    transform: translateY(-1px);
}

.app-tile-main {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.app-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: #0f766e;
    color: #ffffff;
    font-size: 20px;
    font-weight: 800;
}

.app-tile strong,
.app-tile small {
    display: block;
}

.app-tile strong {
    font-size: 18px;
    line-height: 1.2;
}

.app-tile small {
    color: var(--muted);
    margin-top: 4px;
}

.app-tile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 26px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 650;
}

.app-open {
    color: var(--accent-dark);
    font-weight: 750;
}

.flash-stack {
    display: grid;
    gap: 10px;
    max-width: 680px;
    margin-bottom: 18px;
}

.flash {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #ffffff;
    color: var(--text);
}

.flash-error {
    border-color: rgba(180, 35, 24, 0.35);
    color: var(--danger);
}

.flash-success {
    border-color: rgba(40, 114, 75, 0.35);
    color: var(--success);
}

.flash-info {
    border-color: rgba(49, 90, 140, 0.35);
    color: var(--info);
}

@media (max-width: 640px) {
    .site-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 16px;
    }

    .page-shell {
        margin: 28px auto;
    }

    .panel,
    .auth-panel {
        padding: 22px;
    }

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

}
