:root {
    color-scheme: light;
    --ink: #193d46;
    --muted: #4c6769;
    --paper: #fffbed;
    --red: #ac3645;
    font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    color: var(--ink);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100svh;
    display: grid;
    place-items: safe center;
    padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right))
             max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
    background: radial-gradient(#a6c9c0 1px, transparent 1px) 0 0 / 12px 12px #e5f2ee;
}

.comment-card, .success-dialog {
    border: 2px solid var(--ink);
    border-radius: 9px;
    background: var(--paper);
    box-shadow: 4px 5px 0 #acc8bf;
}

.comment-card {
    width: min(100%, 460px);
    min-width: 0;
    overflow: hidden;
}

.park-view {
    height: clamp(96px, 22svh, 174px);
    background: #99ece7 url("./park.webp") center 63% / cover no-repeat;
    border-bottom: 2px dashed #688480;
}

.ticket-body { padding: clamp(16px, 4vw, 28px); }

h1, h2 { margin: 0; line-height: 1.3; }
h1 { font-size: clamp(24px, 6vw, 32px); letter-spacing: .025em; }
.description { margin: 5px 0 20px; font-size: 14px; color: var(--muted); }

label { display: block; margin-bottom: 5px; font-weight: 700; }
.optional-label { margin-left: 4px; font-size: 12px; color: var(--muted); font-weight: 400; }

input, button {
    width: 100%;
    min-height: 46px;
    font: inherit;
    font-size: 16px;
    border-radius: 5px;
}

input {
    padding: 9px 12px;
    border: 1px solid #718785;
    color: var(--ink);
    background: #fffefa;
}
input::placeholder { color: #677675; }

.field-help, .input-help {
    margin: 5px 0 16px;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.5;
}
.input-help { display: flex; justify-content: space-between; gap: 8px; }
#characterCount { font-variant-numeric: tabular-nums; }

button {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border: 2px solid var(--ink);
    background: var(--red);
    color: white;
    box-shadow: 0 3px 0 var(--ink);
    font-weight: 700;
    cursor: pointer;
    touch-action: manipulation;
}
button:hover:enabled { background: #942a39; }
button:active:enabled { transform: translateY(2px); box-shadow: 0 1px 0 var(--ink); }
button:disabled { background: #576c6d; cursor: wait; }
:focus-visible { outline: 3px solid #006f87; outline-offset: 2px; }

.status {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding: 10px 12px;
    border-left: 4px solid currentColor;
    background: #e3f2ec;
}
.status:not([data-state]) { display: none; }
.status[data-state="error"] { background: #fbe8e0; color: #862638; }
.status-icon { font-weight: 800; }
.status-message { margin: 3px 0 0; font-size: 14px; color: var(--ink); }

.success-dialog {
    width: min(360px, calc(100% - 32px));
    max-height: calc(100dvh - 32px);
    padding: 24px;
    color: var(--ink);
    text-align: center;
}
.success-dialog::backdrop { background: #163f48a8; }
.success-check { display: inline-block; margin-bottom: 8px; color: #19705d; font-size: 32px; }
.success-message { margin: 12px 0 20px; overflow-wrap: anywhere; }

@media (max-height: 620px) {
    .park-view { height: 76px; }
    .ticket-body { padding: 14px 16px 18px; }
    .description, .field-help, .input-help { margin-bottom: 10px; }
}

@media (max-height: 450px) and (min-aspect-ratio: 3/2) {
    .comment-card { width: min(100%, 700px); display: grid; grid-template-columns: 27% 1fr; }
    .park-view { height: auto; border: 0; border-right: 2px dashed #688480; }
}
@media (max-height: 450px) and (min-aspect-ratio: 3/2) {
    .ticket-body { padding: 10px 16px 14px; }
    h1 { font-size: 22px; }
    .description { margin: 2px 0 5px; }
    .field-help, .input-help { margin: 2px 0 6px; }
    label { margin-bottom: 2px; }
}
