:root {
    --background: #f5f6f4;
    --surface: #ffffff;
    --ink: #18201d;
    --muted: #5f6b65;
    --line: #d8ddd8;
    --accent: #176b5d;
    --accent-strong: #0d4f44;
    --accent-soft: #e4f2ef;
    --error: #a23434;
    --error-soft: #fff0f0;
    --success: #1d6b43;
    --success-soft: #edf8f0;
    --shadow: 0 22px 55px rgba(24, 32, 29, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background:
        linear-gradient(125deg, rgba(23, 107, 93, 0.12), transparent 38%),
        linear-gradient(315deg, rgba(138, 79, 18, 0.11), transparent 35%),
        var(--background);
    font-family: Arial, Helvetica, sans-serif;
}

.page-shell {
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;
    padding: 42px 0 56px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: stretch;
}

.intro {
    padding-top: 0;
    text-align: center;
}

.eyebrow {
    margin: 0 0 14px;
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    max-width: none;
    font-size: clamp(2.15rem, 4vw, 4rem);
    line-height: 1;
    letter-spacing: 0;
}

.intro-copy {
    max-width: 430px;
    margin: 18px auto 0;
    color: var(--muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.form-panel {
    padding: 28px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 221, 216, 0.95);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.edit-panel {
    padding: 22px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 221, 216, 0.95);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(24, 32, 29, 0.09);
}

.panel-title {
    margin: 0 0 16px;
    display: block;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.25;
}

.edit-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
}

.landing-page {
    width: min(1280px, calc(100% - 32px));
    min-height: 100vh;
    align-content: center;
}

.landing-header {
    display: grid;
    gap: 14px;
    justify-items: start;
    text-align: left;
}

.landing-hero {
    width: 100%;
}

.landing-hero .intro-copy {
    margin: 20px 0 0;
    max-width: 610px;
    color: var(--muted);
    font-size: 1.16rem;
}

.landing-title {
    margin: 0;
    font-size: clamp(3rem, 5vw, 4.8rem);
    line-height: 0.95;
    letter-spacing: 0;
}

.landing-subtitle {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: clamp(1.15rem, 1.8vw, 1.7rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: 0;
}

.landing-actions {
    width: 100%;
    max-width: 100%;
    justify-self: center;
    margin: 0 auto;
}

.dashboard-page {
    width: min(1180px, calc(100% - 32px));
}

.dashboard-intro .intro-copy {
    max-width: 620px;
}

.dashboard-overview {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 280px));
    gap: 16px;
    justify-content: center;
}

.stat-tile {
    min-width: 0;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 221, 216, 0.95);
    border-radius: 8px;
    box-shadow: 0 14px 34px rgba(24, 32, 29, 0.08);
}

.stat-label {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.35;
}

.stat-tile strong {
    display: block;
    margin-top: 8px;
    color: var(--accent-strong);
    font-size: 1.65rem;
    line-height: 1;
}

.dashboard-categories {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.dashboard-category {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(216, 221, 216, 0.95);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(24, 32, 29, 0.1);
}

.dashboard-category-header {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    justify-content: space-between;
}

.dashboard-category h2,
.remote-monitor-card h2 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.category-status {
    flex: 0 0 auto;
    padding: 7px 9px;
    color: var(--success);
    background: var(--success-soft);
    border: 1px solid rgba(29, 107, 67, 0.2);
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 800;
}

.category-status.pending {
    color: var(--muted);
    background: #f8faf8;
    border-color: var(--line);
}

.category-stats {
    display: grid;
    gap: 10px;
    margin: 0;
}

.category-stats div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: baseline;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(216, 221, 216, 0.75);
}

.category-stats div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.category-stats dt {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
}

.category-stats dd {
    min-width: 0;
    margin: 0;
    color: var(--ink);
    font-weight: 800;
    text-align: right;
    overflow-wrap: anywhere;
}

.dashboard-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: auto;
}

.dashboard-actions a {
    display: inline-flex;
    width: 100%;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 12px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid rgba(23, 107, 93, 0.2);
    border-radius: 8px;
    font-weight: 800;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
}

.dashboard-actions a:hover {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.dashboard-actions .view-action {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-color: rgba(23, 107, 93, 0.2);
}

.dashboard-actions .manage-action {
    color: #315f28;
    background: #e9f4e4;
    border-color: rgba(49, 95, 40, 0.24);
}

.dashboard-actions .view-action:hover {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

.dashboard-actions .manage-action:hover {
    color: #ffffff;
    background: #4e8d3f;
    border-color: #4e8d3f;
}

.dashboard-error,
.future-copy {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.future-category {
    background:
        linear-gradient(135deg, rgba(23, 107, 93, 0.08), rgba(138, 79, 18, 0.06)),
        rgba(255, 255, 255, 0.82);
    border-style: dashed;
}

.remote-monitor-section {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    align-items: start;
}

.remote-monitor-card {
    display: grid;
    gap: 18px;
    width: 100%;
    padding: 22px;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(216, 221, 216, 0.95);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(24, 32, 29, 0.1);
}

.add-monitor-card {
    background: rgba(255, 255, 255, 0.95);
    border-style: solid;
}

.monitor-error-status {
    color: var(--error);
    background: var(--error-soft);
    border-color: rgba(162, 52, 52, 0.24);
}

.remote-monitor-summary {
    grid-template-columns: 1fr;
}

.remote-monitor-summary div:last-child {
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(216, 221, 216, 0.75);
}

.remote-monitor-disks {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
    overflow-x: auto;
}

.remote-monitor-disks-label {
    margin: 0 0 8px;
    color: var(--muted);
    font-weight: 800;
    font-size: 0.93rem;
    line-height: 1.35;
}

.remote-monitor-strong {
    color: var(--ink);
    font-weight: 800;
    font-size: 0.93rem;
    line-height: 1.35;
}

.remote-monitor-disks-header {
    display: grid;
    grid-template-columns: minmax(140px, 1.4fr) minmax(80px, 1fr) repeat(4, minmax(58px, 0.55fr));
    gap: 14px;
    min-width: 600px;
    margin: 0 0 8px;
    color: var(--ink);
    font-size: 0.93rem;
    font-weight: 800;
    line-height: 1.35;
    text-transform: uppercase;
    letter-spacing: 0;
}

.remote-monitor-disks-header span:nth-child(n + 3) {
    text-align: right;
}

.remote-monitor-disks ul {
    display: grid;
    gap: 8px;
    min-width: 600px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.remote-monitor-disks li {
    display: grid;
    grid-template-columns: minmax(140px, 1.4fr) minmax(80px, 1fr) repeat(4, minmax(58px, 0.55fr));
    gap: 14px;
    align-items: baseline;
}

.remote-monitor-disks li span {
    color: var(--ink);
    font-weight: 800;
}

.remote-monitor-disks li strong,
.remote-monitor-disks li em {
    font-style: normal;
    color: var(--ink);
    white-space: nowrap;
    font-family: inherit;
    font-size: 0.92rem;
    font-weight: 800;
}

.remote-monitor-disks li em {
    text-align: right;
}

.remote-monitor-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.remote-monitor-panel {
    min-width: 0;
    padding: 16px;
    background: #f8faf8;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.remote-monitor-panel h3 {
    margin: 0 0 12px;
    font-size: 1rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.monitor-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.monitor-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: baseline;
    color: var(--muted);
    font-size: 0.92rem;
}

.monitor-list span {
    min-width: 0;
    overflow-wrap: anywhere;
}

.monitor-list strong {
    color: var(--accent-strong);
}

.thesis-page {
    width: min(1180px, calc(100% - 32px));
}

.thesis-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.thesis-card {
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(216, 221, 216, 0.95);
    border-radius: 8px;
    box-shadow: 0 16px 36px rgba(24, 32, 29, 0.1);
}

.thesis-image {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    background: #e7ece8;
}

.thesis-image-placeholder {
    display: grid;
    place-items: center;
    color: var(--accent-strong);
    background:
        linear-gradient(135deg, rgba(23, 107, 93, 0.14), rgba(138, 79, 18, 0.12)),
        #eef3ef;
    font-size: 1.4rem;
    font-weight: 800;
}

.thesis-content {
    flex: 1 1 auto;
    display: grid;
    gap: 12px;
    padding: 18px;
}

.dataset-card-content {
    display: flex;
    flex-direction: column;
    align-content: normal;
}

.thesis-card h2 {
    margin: 0;
    font-size: 1.2rem;
    line-height: 1.25;
    letter-spacing: 0;
}

.thesis-description {
    margin: 0;
    color: var(--muted);
    line-height: 1.55;
}

.thesis-degree,
.thesis-company {
    margin: 0;
    color: var(--ink);
    font-size: 0.95rem;
    font-weight: 800;
}

.thesis-card time {
    color: var(--accent-strong);
    font-size: 0.92rem;
    font-weight: 800;
}

.dataset-card-keywords {
    gap: 8px;
}

.dataset-card-keywords li {
    padding: 6px 9px;
    font-size: 0.82rem;
}

.dataset-page-link,
.dataset-page-missing {
    align-self: center;
    margin-top: auto;
}

.dataset-page-link {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    color: #ffffff;
    background: var(--accent);
    border-radius: 8px;
    font-weight: 800;
    text-decoration: none;
    transition: background 160ms ease, transform 160ms ease;
}

.dataset-page-link:hover {
    background: var(--accent-strong);
}

.dataset-page-link:active {
    transform: translateY(1px);
}

.dataset-page-link:focus-visible {
    outline: 3px solid rgba(23, 107, 93, 0.28);
    outline-offset: 2px;
}

.dataset-page-missing {
    color: var(--muted);
    font-size: 0.92rem;
    font-weight: 800;
}

.dataset-detail-page {
    width: min(1040px, calc(100% - 32px));
}

.dataset-detail {
    overflow: hidden;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(216, 221, 216, 0.95);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.dataset-detail-image {
    display: block;
    width: 100%;
    max-height: 430px;
    object-fit: cover;
    background: #e7ece8;
}

.dataset-detail-content {
    display: grid;
    gap: 20px;
    padding: 32px;
}

.dataset-lead {
    margin: 0;
    color: var(--muted);
    font-size: 1.18rem;
    line-height: 1.65;
}

.keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.keyword-list li {
    padding: 8px 11px;
    color: var(--accent-strong);
    background: var(--accent-soft);
    border: 1px solid rgba(23, 107, 93, 0.18);
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 800;
}

.dataset-long-description {
    color: var(--ink);
    line-height: 1.7;
}

.dataset-long-description p {
    margin: 0 0 16px;
}

.dataset-long-description h2,
.dataset-long-description h3,
.dataset-long-description h4 {
    margin: 24px 0 12px;
    line-height: 1.25;
    letter-spacing: 0;
}

.dataset-long-description ul,
.dataset-long-description ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.dataset-long-description a {
    color: var(--accent-strong);
    font-weight: 800;
}

.dataset-long-description img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.rich-text-field {
    display: grid;
    gap: 8px;
}

.rich-text-field > label {
    margin-bottom: 0;
}

.rich-text-field textarea {
    min-height: 340px;
}

.tox.tox-tinymce {
    width: 100% !important;
    max-width: 100%;
    overflow: hidden;
    background: #ffffff;
    border: 1px solid var(--line) !important;
    border-radius: 8px !important;
    box-shadow: none !important;
}

.tox .tox-editor-container {
    background: #ffffff;
}

.tox .tox-toolbar-overlord,
.tox .tox-toolbar,
.tox .tox-toolbar__overflow,
.tox .tox-toolbar__primary {
    background: #f8faf8 !important;
}

.tox .tox-toolbar-overlord {
    border-bottom: 1px solid var(--line) !important;
}

.tox .tox-tbtn {
    border-radius: 6px !important;
}

.tox .tox-edit-area::before {
    border: 0 !important;
}

.tox.tox-tinymce:focus-within {
    outline: 3px solid rgba(23, 107, 93, 0.28);
    outline-offset: 2px;
}

.empty-state {
    padding: 28px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(216, 221, 216, 0.95);
    border-radius: 8px;
    text-align: center;
    box-shadow: var(--shadow);
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.thesis-filter {
    display: flex;
    gap: 12px;
    align-items: stretch;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.thesis-filter-button {
    flex: 1 1 0;
    min-width: 0;
    color: var(--accent-strong);
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.thesis-filter-button:hover {
    background: var(--accent-soft);
}

.thesis-filter-button.is-active {
    color: #ffffff;
    background: var(--accent);
    border-color: var(--accent);
}

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

.field-group {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

legend,
.field span,
.field > label {
    display: block;
    margin-bottom: 8px;
    color: var(--ink);
    font-size: 0.93rem;
    font-weight: 700;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.choice {
    position: relative;
    min-height: 48px;
}

.choice input {
    position: absolute;
    inset: 0;
    opacity: 0;
}

.choice span {
    display: grid;
    min-height: 48px;
    place-items: center;
    padding: 10px 14px;
    color: var(--muted);
    background: #f8faf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
    text-align: center;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.choice input:checked + span {
    color: var(--accent-strong);
    background: var(--accent-soft);
    border-color: var(--accent);
}

.choice input:focus-visible + span,
input:focus-visible,
textarea:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(23, 107, 93, 0.28);
    outline-offset: 2px;
}

.field {
    display: block;
    min-width: 0;
}

input[type='text'],
input[type='date'],
input[type='file'],
select,
textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 13px;
    color: var(--ink);
    background: #ffffff;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
}

input[type='file'] {
    padding: 10px 12px;
}

input[readonly] {
    color: var(--muted);
    background: #f8faf8;
}

textarea {
    min-height: 170px;
    resize: vertical;
    line-height: 1.5;
}

.check-field {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 12px 14px;
    color: var(--ink);
    background: #f8faf8;
    border: 1px solid var(--line);
    border-radius: 8px;
    font-weight: 700;
}

.check-field input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    flex: 0 0 auto;
}

.check-field span {
    line-height: 1.35;
}

button {
    min-height: 50px;
    padding: 12px 18px;
    color: #ffffff;
    background: var(--accent);
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

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

button:active {
    transform: translateY(1px);
}

.notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid;
    border-radius: 8px;
    line-height: 1.45;
}

.notice[hidden] {
    display: none;
}

.conditional-field[hidden] {
    display: none;
}

.notice p {
    margin: 0 0 8px;
    font-weight: 700;
}

.notice ul {
    margin: 0;
    padding-left: 20px;
}

.success {
    color: var(--success);
    background: var(--success-soft);
    border-color: rgba(29, 107, 67, 0.28);
}

.error {
    color: var(--error);
    background: var(--error-soft);
    border-color: rgba(162, 52, 52, 0.28);
}

@media (max-width: 820px) {
    .page-shell {
        gap: 26px;
        padding: 32px 0;
    }

    h1 {
        font-size: 2.45rem;
        line-height: 1;
    }

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

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

}

@media (max-width: 540px) {
    .page-shell {
        width: min(100% - 22px, 1120px);
    }

    .form-panel {
        padding: 18px;
    }

    .dataset-detail-content {
        padding: 22px;
    }

    .edit-controls {
        grid-template-columns: 1fr;
    }

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

    h1 {
        font-size: 2.1rem;
    }

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

    .dashboard-overview,
    .dashboard-categories,
    .dashboard-actions,
    .landing-actions,
    .remote-monitor-grid,
    .remote-monitor-summary,
    .remote-monitor-section {
        grid-template-columns: 1fr;
    }

    .landing-page {
        align-content: start;
    }

    .thesis-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .thesis-filter-button {
        width: 100%;
    }
}
