:root {
    --text: #111111;
    --muted: #666666;
    --line: #151515;
    --background: #ffffff;
    --soft: #f4f4f4;
    --danger: #a10d0d;
    --success: #eaf7ec;
    --error: #fff0f0;
}

* {
    box-sizing: border-box;
}

html {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        Helvetica, Arial, sans-serif;
    color: var(--text);
    background: var(--background);
}

body {
    margin: 0;
}

a {
    color: #0645d6;
}

button,
input,
textarea,
select {
    font: inherit;
}

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

.site-header {
    border-bottom: 1px solid #d8d8d8;
    background: #ffffff;
}

.header-inner {
    min-height: 66px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    color: #111111;
    font-size: 1.5rem;
    font-weight: 800;
    text-decoration: none;
}

nav {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

nav a,
.link-button {
    color: #111111;
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.inline-form {
    display: inline;
}

main {
    padding: 36px 0 64px;
}

h1 {
    margin: 0 0 24px;
    font-size: clamp(1.8rem, 4vw, 2.35rem);
}

h2 {
    margin-top: 36px;
}

.actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 0 0 20px;
}

.button {
    display: inline-block;
    padding: 10px 15px;
    border: 1px solid #111111;
    border-radius: 7px;
    color: #ffffff;
    background: #111111;
    text-decoration: none;
    cursor: pointer;
}

.button.secondary {
    color: #111111;
    background: #ffffff;
}

.button.danger {
    color: #ffffff;
    background: var(--danger);
    border-color: var(--danger);
}

.button.success {
    color: #ffffff;
    background: #1f7a3d;
    border-color: #1f7a3d;
    justify-self: stretch;
    text-align: center;
}

.form-grid {
    display: grid;
    gap: 17px;
    max-width: 700px;
}

label {
    display: grid;
    gap: 7px;
    font-weight: 650;
}

input,
textarea,
select {
    width: 100%;
    padding: 11px;
    border: 1px solid #999999;
    border-radius: 6px;
    background: #ffffff;
    font-weight: 400;
}

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

.notice {
    padding: 12px 14px;
    margin-bottom: 20px;
    border: 1px solid #888888;
}

.notice.success {
    background: var(--success);
}

.notice.error {
    background: var(--error);
}

.trip-list,
.admin-table,
.planner {
    width: 100%;
    border-collapse: collapse;
}

.trip-list th,
.trip-list td,
.admin-table th,
.admin-table td {
    padding: 12px;
    text-align: left;
    vertical-align: top;
    border: 1px solid var(--line);
}

.planner {
    table-layout: fixed;
}

.planner td {
    padding: 11px 14px;
    vertical-align: top;
    border: 2px solid var(--line);
}

.planner .date-cell {
    width: 28%;
    font-size: 1.06rem;
}

.planner .content-cell {
    width: 75%;
    padding: 0;
}

.day-entries {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.day-entries td {
    padding: 11px 14px;
    vertical-align: top;
    border: 0;
}

.day-entries .time-cell {
    width: 43%;
    color: var(--muted);
    border-right: 1px solid var(--line);
    font-weight: 750;
    white-space: nowrap;
}

.day-entries .entry-content {
    position: relative;
    padding-right: 46px;
    line-height: 1.48;
}

.entry-title {
    font-size: 1.08rem;
    font-weight: 700;
}

.entry-description {
    margin-top: 8px;
    white-space: pre-wrap;
}

.entry-actions {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.entry-edit {
    display: inline-block;
    width: 28px;
    padding: 4px;
    border: 0;
    border-radius: 4px;
    color: #0645d6;
    background: transparent;
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1;
    text-align: center;
    text-decoration: none;
}

.entry-edit:hover,
.entry-edit:focus-visible {
    background: var(--soft);
}

.entry-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    padding: 3px;
    border-radius: 4px;
    color: #0645d6;
    text-decoration: none;
}

.time-cell .entry-link {
    display: flex;
    width: 22px;
    height: 22px;
    padding: 0;
    justify-content: flex-start;
    margin-top: 7px;
}

.entry-link svg {
    width: 22px;
    height: 22px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.7;
}

.entry-link:hover,
.entry-link:focus-visible {
    background: var(--soft);
}

.empty {
    padding: 18px;
    border: 1px solid #999999;
}

.meta {
    color: var(--muted);
    font-size: 0.95rem;
}

.day-overview {
    max-width: 700px;
    margin: 24px 0;
    padding: 16px;
    border: 1px solid #999999;
}

.day-overview h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.day-overview p {
    margin: 0;
    color: var(--muted);
}

.day-overview-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 12px;
    padding: 8px 0;
    border-top: 1px solid #d4d4d4;
}

.day-overview-row span {
    color: var(--muted);
    font-weight: 400;
}

.day-overview-row .day-overview-title {
    color: var(--text);
}


.danger-zone {
    margin-top: 46px;
    padding-top: 20px;
    border-top: 2px solid var(--danger);
}

.print-shell {
    width: min(820px, calc(100% - 48px));
    margin: 44px auto;
}

.print-actions {
    margin-bottom: 28px;
}

.print-header {
    padding-bottom: 20px;
    border-bottom: 2px solid var(--line);
}

.print-header > span {
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.12em;
}

.print-header h1 {
    margin: 10px 0 6px;
}

.print-header p {
    margin: 0;
    color: var(--muted);
}

.print-day {
    margin-top: 28px;
    break-inside: avoid;
}

.print-day h2 {
    margin: 0;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
}

.print-entry {
    display: grid;
    grid-template-columns: 100px 1fr;
    gap: 16px;
    padding: 13px 0;
    border-bottom: 1px solid #c8c8c8;
    break-inside: avoid;
}

.print-time {
    color: var(--muted);
    font-weight: 750;
}

.print-entry p {
    margin: 6px 0 0;
    white-space: normal;
}

.print-link {
    font-size: 0.9rem;
    color: var(--muted);
    overflow-wrap: anywhere;
}

.site-footer {
    padding: 25px 0;
    color: var(--muted);
    border-top: 1px solid #d8d8d8;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    gap: 16px;
}

.footer-inner nav {
    gap: 14px;
}

.legal-page {
    max-width: 760px;
}

.legal-page h2 {
    margin-top: 32px;
    font-size: 1.2rem;
}

.legal-page p,
.legal-page li {
    line-height: 1.55;
}

.admin-actions {
    display: flex;
    gap: 7px;
    flex-wrap: wrap;
}

.admin-actions button {
    padding: 6px 8px;
}

@media (max-width: 720px) {
    .header-inner {
        align-items: flex-start;
        flex-direction: column;
        padding: 14px 0;
    }

    nav {
        gap: 12px;
    }

    .planner,
    .planner tbody,
    .planner tr,
    .planner td {
        display: block;
        width: 100%;
    }

    .planner tr {
        margin-bottom: -2px;
        border: 2px solid var(--line);
    }

    .planner td {
        border: 0;
    }

    .planner .date-cell {
        width: 100%;
        font-weight: 750;
        background: var(--soft);
        border-bottom: 1px solid var(--line);
    }

    .planner .content-cell {
        width: 100%;
        padding: 0;
    }

    .day-entries,
    .day-entries tbody,
    .day-entries tr {
        display: table;
        width: 100%;
    }

    .day-entries tr {
        margin: 0;
        border: 0;
    }

    .day-entries td {
        display: table-cell;
        width: auto;
    }

    .day-entries .time-cell {
        width: 43%;
    }

    .admin-table {
        display: block;
        overflow-x: auto;
        font-size: 0.9rem;
    }

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

@media print {
    .print-actions {
        display: none;
    }

    .print-shell {
        width: auto;
        margin: 0;
    }

    .print-document {
        color: #000000;
        background: #ffffff;
    }
}
