:root {
    --bg: #f4f1ea;
    --panel: #fffdf8;
    --ink: #1c1915;
    --muted: #6d6458;
    --line: #e4ddd2;
    --accent: #0f6b5c;
    --accent-ink: #fff;
    --chip: #efe8dc;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.45;
}

.top,
.filters,
.tabs,
.jobs,
.panel,
.pager,
.result-meta,
.flash,
.questions {
    width: min(1100px, calc(100% - 32px));
    margin-left: auto;
    margin-right: auto;
}

.top {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-end;
    padding: 32px 0 16px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 8px;
    text-decoration: none;
    color: inherit;
}

.brand-icon {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.brand-word {
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1;
}

.brand-relevant {
    color: var(--ink);
}

.brand-me {
    color: var(--accent);
}

.muted,
.hint,
.result-meta {
    color: var(--muted);
}

.stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    font-size: 0.92rem;
    color: var(--muted);
}

.filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 14px 16px;
    margin-bottom: 18px;
}

.posted {
    min-width: 160px;
}

.job-search input {
    min-width: 220px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 12px;
    background: white;
    color: var(--ink);
    font: inherit;
}

.posted select {
    min-width: 160px;
}

.state-picker {
    position: relative;
}

.state-picker summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
}

.state-picker summary::-webkit-details-marker {
    display: none;
}

.state-picker summary strong {
    font-weight: 650;
    color: var(--accent);
}

.state-picker[open] summary {
    border-color: var(--accent);
}

.state-menu {
    position: absolute;
    z-index: 3;
    top: calc(100% + 6px);
    left: 0;
    width: min(420px, 80vw);
    padding: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(28, 25, 21, 0.08);
}

.state-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.state-option {
    flex-direction: row;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    font-weight: 650;
}

.state-picker .hint {
    margin: 8px 0 0;
}

.company-picker summary {
    max-width: 280px;
}

.company-picker summary strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.company-menu {
    width: min(360px, 80vw);
}

.company-search {
    width: 100%;
    margin-bottom: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 8px 10px;
    font: inherit;
}

.company-list {
    max-height: 280px;
    overflow: auto;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.company-option {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 6px 8px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 600;
    width: 100%;
    box-sizing: border-box;
}

.company-option:hover {
    background: var(--chip);
}

.checks {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-left: auto;
}

.filter-submit {
    white-space: nowrap;
}

.sync-btn {
    display: inline-block;
    background: var(--accent);
    color: var(--accent-ink);
    text-decoration: none;
    border: 0;
    border-radius: 999px;
    padding: 10px 18px;
    font: inherit;
    font-weight: 650;
    white-space: nowrap;
    cursor: pointer;
}

.sync-form {
    display: inline;
    margin: 0;
}

.sync-btn-off {
    opacity: 0.65;
    cursor: default;
}

.sync-btn-stop {
    background: #8a2f2f;
    color: #fff;
}

.sync-btn-stop:hover {
    background: #6f2323;
}

.sync-note {
    max-width: 420px;
}

.check {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-bottom: 0;
}

.title-link {
    color: inherit;
    text-decoration: none;
}

.title-link:hover {
    text-decoration: underline;
    color: var(--accent);
}

.badge {
    background: #e7f3ef;
    color: var(--accent);
    border-radius: 999px;
    padding: 2px 8px;
    font-weight: 700;
    font-size: 0.78rem;
}

label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

select,
button {
    font: inherit;
}

select {
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    background: white;
}

.states select {
    min-width: 240px;
}

.hint {
    font-weight: 400;
    font-size: 0.78rem;
}

button {
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 10px 18px;
    cursor: pointer;
    font-weight: 600;
}

button.btn-primary,
.filter-submit,
.paste-job button[type="submit"] {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

button.btn-save {
    background: #e7f3ef;
    color: var(--accent);
    border-color: #b7d7ce;
}

button.btn-save:hover {
    background: #d9ebe4;
}

.bulk-create-status {
    flex-basis: 100%;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 600;
}

.paste-job {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.paste-job input,
.paste-job textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 8px 10px;
    font: inherit;
    background: white;
}

.paste-job button {
    align-self: flex-start;
}

.panel {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 24px;
}

.jobs {
    list-style: none;
    padding: 0;
    margin: 0 auto 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bulk-bar {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto 12px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 12px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 14px;
}

.bulk-select-all {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
    font-size: 0.92rem;
    color: var(--muted);
    cursor: pointer;
}

.job {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 18px 20px;
}

.job-check {
    display: flex;
    align-items: flex-start;
    padding-top: 4px;
    cursor: pointer;
}

.job-check input,
.bulk-select-all input {
    width: 16px;
    height: 16px;
    accent-color: var(--accent);
}

.job h2 {
    margin: 0 0 4px;
    font-size: 1.15rem;
}

.company {
    margin: 0 0 8px;
    font-weight: 600;
}

.source {
    display: inline-block;
    margin-left: 8px;
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--muted);
    background: var(--chip);
    border-radius: 999px;
    padding: 2px 8px;
    vertical-align: middle;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.excerpt {
    margin: 10px 0 0;
    color: #433d36;
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 14px;
}

.tabs a {
    color: var(--ink);
    text-decoration: none;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    font-weight: 650;
}

.tabs a.on {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: var(--accent);
}

.tabs span {
    margin-left: 6px;
    font-weight: 600;
    opacity: 0.8;
}

.choice {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 8px 14px;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    color: var(--ink);
}

.discard,
button.discard {
    background: #fff7f3;
    color: #9a3412;
    border-color: #e7c4b0;
}

.discard:hover,
button.discard:hover {
    background: #ffefe8;
}

.job-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
    min-width: 140px;
}

.action-menu {
    position: relative;
    align-self: flex-end;
}

.action-menu > summary {
    list-style: none;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
    background: var(--panel);
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 9px 14px;
    font: inherit;
    font-weight: 650;
}

.action-menu > summary:hover {
    background: var(--chip);
    border-color: #d4cbc0;
}

.action-menu[open] > summary {
    background: var(--chip);
    border-color: #c9bfb3;
}

.action-menu > summary::-webkit-details-marker {
    display: none;
}

.action-menu > summary::after {
    content: " ▾";
    font-weight: 400;
    opacity: 0.85;
}

.action-menu-list {
    position: absolute;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
    min-width: 168px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 6px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(28, 25, 23, 0.12);
}

.action-menu-list form {
    margin: 0;
}

.action-menu-list button,
.action-menu-list a {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: left;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    padding: 9px 12px;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
}

.action-menu-list button:hover,
.action-menu-list a:hover {
    background: rgba(28, 25, 23, 0.06);
}

.action-menu-list .danger {
    color: #9a3412;
}

.action-menu-list .menu-primary {
    color: var(--accent);
    font-weight: 650;
}

.apply {
    align-self: center;
    white-space: nowrap;
    background: #e7f3ef;
    color: var(--accent);
    border: 1px solid #b7d7ce;
    text-decoration: none;
    border-radius: 999px;
    padding: 10px 16px;
    font: inherit;
    font-weight: 650;
    cursor: pointer;
}

.apply:hover {
    background: #d9ebe4;
}

.resume-file {
    color: var(--accent);
    font-weight: 650;
    font-size: 0.88rem;
    word-break: break-all;
    text-align: right;
}

.recreate {
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    text-align: right;
}

.open-posting {
    color: var(--muted);
    font-size: 0.88rem;
}

.flash,
.questions {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto 16px;
}

.flash {
    background: #e7f3ef;
    border: 1px solid #b7d7ce;
    border-radius: 12px;
    padding: 12px 16px;
}

.question {
    display: block;
    margin: 0 0 14px;
}

.question textarea,
.question select {
    display: block;
    width: 100%;
    margin-top: 6px;
    font: inherit;
    padding: 8px;
}

.pager {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding-bottom: 40px;
}

.error {
    color: #9b2c2c;
}

.header-link {
    color: var(--muted);
    font-weight: 600;
    text-decoration: none;
}

.header-link:hover {
    color: var(--ink);
}

.logout-form {
    display: inline;
}

.logout-form button {
    background: transparent;
    border: 0;
    padding: 0;
    color: var(--muted);
    font-weight: 600;
}

.login-wrap {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 32px 16px;
}

.login-card {
    width: min(420px, 100%);
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 28px 24px;
}

.login-card input {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    background: white;
    color: var(--ink);
    font: inherit;
}

.login-card .btn-primary {
    align-self: flex-start;
    margin-top: 4px;
}

.sessions {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto 40px;
}

.session-scroll {
    overflow-x: auto;
}

.session-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 720px;
}

.session-table th {
    text-align: left;
    font-size: 0.78rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--muted);
    padding: 0 10px 10px;
}

.session-table td {
    padding: 14px 10px;
    border-top: 1px solid var(--line);
    vertical-align: top;
}

.session-table .ip {
    display: block;
    margin-top: 2px;
    color: var(--muted);
    font-size: 0.82rem;
}

.session-status {
    display: inline-block;
    margin-left: 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.session-status.active {
    color: var(--accent);
}

pre {
    background: #1c1915;
    color: #f4f1ea;
    padding: 16px;
    border-radius: 12px;
    overflow-x: auto;
}

@media (max-width: 800px) {
    .top,
    .job,
    .filters {
        display: block;
    }

    .filters label,
    .filters button,
    .filters .sync-btn {
        width: 100%;
        margin-top: 8px;
        box-sizing: border-box;
        text-align: center;
    }

    .apply {
        display: inline-block;
        margin-top: 12px;
    }
}
