:root {
    --bg: #f5f7fb;
    --surface: #ffffff;
    --surface-soft: #eef3f8;
    --text: #1f2937;
    --muted: #526071;
    --line: #d6dee8;
    --primary: #1d4ed8;
    --primary-dark: #153eaf;
    --focus: #16a34a;
    --danger-soft: #fff1f1;
    --danger-line: #efb3b3;
    --danger-text: #9f1239;
    --warning-soft: #fff8e8;
    --warning-line: #f2d189;
    --warning-text: #7c4a03;
    --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-family: Arial, sans-serif;
    line-height: 1.5;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
}

a {
    color: inherit;
}

.wrap {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}

.narrow {
    width: min(860px, calc(100% - 2rem));
}

.skip-link {
    position: absolute;
    top: 0.75rem;
    right: 1rem;
    left: auto;
    transform: translateY(-220%);
    background: #ffffff;
    color: #1f2937;
    padding: 0.9rem 1.2rem;
    border: 3px solid #1d4ed8;
    border-radius: 0.9rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    font-weight: 700;
    z-index: 1000;
    text-decoration: none;
}

.skip-link:focus,
.skip-link:focus-visible {
    transform: translateY(0);
    outline: 3px solid #22c55e;
    outline-offset: 3px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

.site-header,
.sub-header {
    background: linear-gradient(135deg, #0f766e, #155e75);
    color: #ffffff;
    padding: 2rem 0;
    margin-bottom: 1.5rem;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
}

.page-title {
    margin: 0 0 0.5rem;
    font-size: clamp(1.8rem, 2.3vw, 2.6rem);
    line-height: 1.15;
}

.page-title.sub {
    font-size: clamp(1.5rem, 2vw, 2.1rem);
}

.page-intro,
.page-status {
    margin: 0.25rem 0 0;
    max-width: 60ch;
}

.button-link {
    display: inline-block;
    background: #ffffff;
    color: #0f3d91;
    padding: 0.8rem 1rem;
    border-radius: 999px;
    text-decoration: none;
    font-weight: 700;
    border: none;
}

.button-link:hover,
.button-link:focus-visible {
    background: #dbeafe;
}

.button-submit {
    margin-top: 1rem;
    cursor: pointer;
}

.inline-link {
    margin-top: 0.5rem;
}

.layout-grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(260px, 0.9fr);
    gap: 1.5rem;
    align-items: start;
    padding-bottom: 2rem;
}

.main-panel,
.side-panel,
.login-card,
.notice-card,
.admin-card,
.info-box {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.main-panel,
.notice-card,
.admin-card,
.info-box,
.login-card {
    padding: 1.25rem;
}

.section-title {
    margin: 0 0 1rem;
    font-size: 1.35rem;
}

.section-title.small {
    font-size: 1.05rem;
}

.card-grid,
.sub-grid,
.notice-list,
.inline-actions {
    list-style: none;
    margin: 0;
    padding: 0;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.sub-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.card {
    position: relative;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
    padding: 1rem;
    min-height: 130px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.card:hover,
.card:focus-within {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
    border-color: #b7c5d8;
}

.card-heading {
    margin: 0;
    font-size: 1.2rem;
    overflow-wrap: anywhere;
    word-break: normal;
}

.card-link {
    color: var(--text);
    text-decoration: none;
    font-weight: 700;
}

.card-link:hover,
.card-link:focus-visible {
    text-decoration: underline;
}

.stretched-link::after {
    content: "";
    position: absolute;
    inset: 0;
}

.card-subtitle {
    margin-top: 0.6rem;
    color: #475569;
    font-size: 0.98rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.card-meta {
    margin-top: 0.75rem;
    color: #475569;
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.card-text {
    margin-top: 0.75rem;
    color: var(--text);
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.concept-card {
    border-style: dashed;
    border-width: 2px;
    border-color: var(--warning-line);
    background: var(--warning-soft);
}

.card-sensory {
    background: #fff4dc;
    border: 2px solid #f3c96b;
}

.card-sensory .card-link {
    color: #7c4a03;
}

.card-academy {
    background: #eefbf3;
    border: 2px solid #7ccf9b;
}

.card-academy .card-link {
    color: #166534;
}

.card-sensory:focus-within,
.card-sensory:hover,
.card-academy:focus-within,
.card-academy:hover {
    box-shadow: 0 0 0 4px rgba(29, 78, 216, 0.14);
}

.notice-list li + li {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--line);
}

.notice-label {
    display: inline-block;
    margin-bottom: 0.3rem;
    font-weight: 700;
    color: #0f3d91;
}

.content-block {
    padding-bottom: 2rem;
}

.content-block > * + * {
    margin-top: 1rem;
}

.back-link {
    display: inline-block;
    margin-bottom: 1rem;
    color: #ffffff;
    font-weight: 700;
    text-decoration: underline;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.mini-action {
    display: inline-block;
    padding: 0.65rem 0.9rem;
    background: #eef6ff;
    border: 1px solid #bfd7ff;
    border-radius: 0.75rem;
    color: #0f3d91;
    text-decoration: none;
    font-weight: 600;
}

.mini-action:hover,
.mini-action:focus-visible {
    background: #dbeafe;
}

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

.field-label {
    display: block;
    margin: 0.85rem 0 0.35rem;
    font-weight: 700;
}

input[type="text"],
input[type="password"],
input[type="file"] {
    width: 100%;
    padding: 0.85rem 0.95rem;
    border: 1px solid #b8c4d4;
    border-radius: 0.85rem;
    font-size: 1rem;
    background: #ffffff;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="file"]:focus,
a:focus-visible,
button:focus-visible {
    outline: 3px solid var(--focus);
    outline-offset: 3px;
}

.success-box {
    border-color: #86d19b;
    background: #edf9f0;
}

.error-box {
    border-color: #e6a8a8;
    background: #fff1f1;
}

.concept-box {
    border: 2px dashed var(--warning-line);
    background: var(--warning-soft);
}

.concept-note {
    margin-top: 0.75rem;
    color: #b91c1c;
    font-weight: 700;
}

.muted-box,
.trash-box {
    background: var(--surface-soft);
    border-color: #cbd8e6;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
}

.search-form,
.upload-form,
.trash-empty-form {
    margin-top: 0.75rem;
}

.file-list {
    list-style: none;
    margin: 1rem 0 0;
    padding: 0;
    display: grid;
    gap: 0.85rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfcfe;
}

.file-meta {
    display: grid;
    gap: 0.25rem;
    min-width: 0;
}

.file-name {
    overflow-wrap: anywhere;
    word-break: normal;
}

.file-details {
    color: var(--muted);
    font-size: 0.95rem;
    overflow-wrap: anywhere;
}

.file-actions-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.file-actions-inline form,
.trash-empty-form {
    margin: 0;
}

.mini-action-danger {
    background: var(--danger-soft);
    border-color: var(--danger-line);
    color: var(--danger-text);
}

.mini-action-danger:hover,
.mini-action-danger:focus-visible {
    background: #ffe0e0;
}

@media (max-width: 900px) {
    .layout-grid {
        grid-template-columns: 1fr;
    }

    .header-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 720px) {
    .file-item {
        flex-direction: column;
    }

    .file-actions-inline {
        width: 100%;
    }

    .card-grid,
    .sub-grid {
        grid-template-columns: 1fr;
    }
}

