* {
    box-sizing: border-box;
}

:root {
    --ink: #26332d;
    --muted: #627068;
    --paper: #ffffff;
    --surface: #eef2ef;
    --line: #d9e0dc;
    --accent: #4a6a59;
    --accent-dark: #3d584a;
    --warm: #f5efe6;
}

body {
    margin: 0;
    min-height: 100vh;
    padding: 40px 20px;

    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    background-color: var(--surface);
}

.loading-state {
    margin-top: 25vh;
    color: var(--muted);
    text-align: center;
}

.stack-actions {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.empty-state,
.data-note {
    color: var(--muted);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.portfolio-card {
    margin-bottom: 0;
}

.page-container {
    width: 100%;
    max-width: 760px;
    margin: 0 auto;
}

.wide-page {
    max-width: 1040px;
}

header {
    margin-bottom: 30px;
    text-align: center;
}

.top-nav {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.top-nav a,
.text-link {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 0 13px;

    color: var(--accent-dark);
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;

    background-color: #f8faf8;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.top-nav a:hover,
.text-link:hover {
    background-color: var(--warm);
}

h1 {
    margin-bottom: 8px;
    font-size: 2.4rem;
    font-weight: 600;
}

.subtitle {
    margin-top: 0;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

.card {
    margin-bottom: 24px;
    padding: 28px;

    background-color: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(38, 51, 45, 0.08);
}

h2 {
    margin-top: 0;
    margin-bottom: 22px;
    font-size: 1.5rem;
}

.form-group {
    margin-bottom: 20px;
}

.form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

.helper-text {
    margin: -6px 0 20px;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.5;
}

.helper-text a {
    color: var(--accent-dark);
    font-weight: 700;
}

label {
    display: block;
    margin-bottom: 8px;

    font-size: 0.95rem;
    font-weight: 600;
}

select,
textarea,
input[type="text"],
input[type="file"] {
    width: 100%;
    padding: 12px;

    font: inherit;
    color: var(--ink);
    background-color: var(--paper);

    border: 1px solid #aebbb4;
    border-radius: 8px;
}

textarea {
    min-height: 92px;
    resize: vertical;
}

input[type="file"] {
    background-color: #f8faf8;
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

select:focus,
textarea:focus,
input[type="text"]:focus,
input[type="file"]:focus {
    outline: 3px solid rgba(74, 106, 89, 0.18);
    border-color: var(--accent);
}

button {
    width: 100%;
    padding: 13px 18px;

    font: inherit;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--accent);

    border: none;
    border-radius: 8px;
    cursor: pointer;
}

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

.secondary-button {
    color: var(--accent-dark);
    background-color: #f8faf8;
    border: 1px solid var(--line);
}

.secondary-button:hover {
    background-color: var(--warm);
}

button:focus {
    outline: 3px solid rgba(74, 106, 89, 0.28);
    outline-offset: 2px;
}

.assignment-details {
    margin: 0;
}

.assignment-row {
    padding: 12px 0;
    border-bottom: 1px solid #e5eae7;
}

.assignment-row:last-child {
    border-bottom: none;
}

.assignment-label {
    display: block;
    margin-bottom: 4px;

    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.assignment-value {
    margin: 0;
    line-height: 1.5;
}

.assignment-help {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.55;
}

.accept-form {
    margin-top: 24px;
}

.inline-action-form {
    margin-top: 12px;
}

.assignment-extension {
    margin-top: 24px;
    padding: 20px;
    background-color: #f8faf8;
    border: 1px solid #e5eae7;
    border-radius: 8px;
}

.assignment-extension h3 {
    margin: 18px 0 10px;
    font-size: 1rem;
}

.assignment-extension h3:first-child {
    margin-top: 0;
}

.guidance-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding-left: 20px;
}

.guidance-list li {
    line-height: 1.5;
}

.guidance-list strong,
.guidance-list span,
.guidance-list em {
    display: block;
}

.guidance-list em {
    color: var(--muted);
    font-style: normal;
}

.field-note {
    margin: 18px 0 0;
    color: var(--muted);
    line-height: 1.6;
}

.empty-message {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.journal-section {
    margin-top: 34px;
}

.section-heading {
    margin-bottom: 18px;
}

.with-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.section-heading h2 {
    margin-bottom: 8px;
}

.section-heading p {
    max-width: 660px;
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.journal-list {
    display: grid;
    gap: 22px;
}

.compact-list {
    gap: 18px;
}

.journal-card {
    padding: 24px;
    background-color: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(38, 51, 45, 0.06);
}

.journal-card-header {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 18px;
    align-items: start;
    margin-bottom: 20px;
}

.journal-date {
    margin: 0 0 5px;
    color: var(--muted);
    font-size: 0.9rem;
}

.status-label {
    display: inline-flex;
    margin: 0 0 8px;
    padding: 4px 8px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    background-color: #f8faf8;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.journal-card h3 {
    margin: 0;
    font-size: 1.2rem;
}

.best-photo {
    width: 132px;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background-color: var(--warm);
}

.assignment-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 18px;
    margin: 0 0 22px;
    padding: 16px;
    background-color: #f8faf8;
    border: 1px solid #e5eae7;
    border-radius: 8px;
}

.assignment-summary dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.assignment-summary dd {
    margin: 4px 0 0;
    line-height: 1.45;
}

.journal-form {
    display: grid;
    gap: 12px;
}

.photo-fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 4px;
}

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

.photo-slot {
    display: grid;
    gap: 10px;
    padding: 14px;
    background-color: #f8faf8;
    border: 1px solid #e5eae7;
    border-radius: 8px;
}

.slot-photo {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    background-color: var(--warm);
}

.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 4px 0;
    color: var(--ink);
    font-weight: 600;
}

.feedback-box {
    padding: 16px;
    background-color: #f8faf8;
    border: 1px solid #e5eae7;
    border-radius: 8px;
}

.feedback-box h4 {
    margin: 0 0 8px;
}

.feedback-box p {
    margin: 0 0 12px;
    color: var(--muted);
    line-height: 1.55;
}

.feedback-box ul {
    margin: 6px 0 14px;
    padding-left: 20px;
}

.feedback-box li {
    margin-bottom: 6px;
    line-height: 1.45;
}

.link-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

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

.portfolio-card {
    overflow: hidden;
    background-color: var(--paper);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(38, 51, 45, 0.06);
}

.portfolio-photo,
.portfolio-placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
}

.portfolio-photo-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2px;
    background-color: var(--warm);
}

.portfolio-photo {
    display: block;
    object-fit: cover;
    background-color: var(--warm);
}

.portfolio-placeholder {
    display: grid;
    place-items: center;
    color: var(--muted);
    font-weight: 700;
    background-color: var(--warm);
}

.portfolio-body {
    padding: 22px;
}

.portfolio-body h3 {
    margin: 0 0 8px;
    font-size: 1.25rem;
}

.portfolio-body p {
    margin: 0 0 18px;
    color: var(--muted);
    line-height: 1.55;
}

.portfolio-meta {
    display: grid;
    gap: 10px;
    margin: 0 0 20px;
    padding: 14px;
    background-color: #f8faf8;
    border: 1px solid #e5eae7;
    border-radius: 8px;
}

.portfolio-meta dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.portfolio-meta dd {
    margin: 4px 0 0;
    line-height: 1.45;
}

@media (max-width: 600px) {
    body {
        padding: 24px 14px;
    }

    h1 {
        font-size: 2rem;
    }

    .card {
        padding: 22px;
    }

    .journal-card {
        padding: 20px;
    }

    .form-grid,
    .journal-card-header,
    .assignment-summary,
    .photo-fields,
    .photo-slots,
    .portfolio-photo-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }

    .with-actions {
        display: grid;
    }

    .link-actions {
        justify-content: flex-start;
    }

    .best-photo {
        width: 100%;
    }
}
