:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #202c27;
  background: #f5f6f2;
  font-synthesis: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; padding: 48px 20px; }
main { width: 100%; max-width: 460px; margin: 0 auto; }
header { margin-bottom: 32px; }
.eyebrow { margin: 0 0 10px; color: #58665e; font-size: 13px; }
h1 { margin: 0; font-size: clamp(28px, 7vw, 34px); letter-spacing: -1px; line-height: 1.2; }
form { padding: 28px; background: #fff; border: 1px solid #dfe5dc; border-radius: 20px; }
.field { margin: 0 0 26px; padding: 0; border: 0; min-width: 0; }
label, legend { display: block; padding: 0; margin-bottom: 10px; font-size: 15px; font-weight: 600; }
.optional { margin-left: 6px; color: #647168; font-size: 12px; font-weight: 400; }
button, input, textarea { font: inherit; }
textarea, input[type="date"] {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 13px 14px;
  border: 1px solid #bbc7be;
  border-radius: 10px;
  background: #fff;
  color: inherit;
  font-size: 16px;
  line-height: 1.5;
}
textarea { resize: vertical; min-height: 106px; }
textarea::placeholder { color: #778178; }
.categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
button { cursor: pointer; touch-action: manipulation; }
.deadline-shortcuts { display: flex; gap: 8px; margin-top: 8px; }
.deadline-shortcut { flex: 1; }
.category, .deadline-shortcut {
  min-height: 48px;
  padding: 10px 3px;
  border: 1px solid #bbc7be;
  border-radius: 10px;
  color: #405047;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
}
.category[aria-pressed="true"] { color: #145c35; background: #e4f3e8; border: 2px solid #247344; padding: 9px 2px; }
.hint { margin: 9px 0 0; color: #647168; font-size: 12px; line-height: 1.5; }
.print-shortcut { text-align: center; }
.print { width: 100%; min-height: 58px; border: 0; border-radius: 12px; background: #218447; color: white; font-size: 18px; font-weight: 650; }
:focus-visible { outline: 3px solid #226fba; outline-offset: 3px; }
.status { margin: 14px 0 0; color: #58665e; font-size: 14px; line-height: 1.5; }
.status:empty { display: none; }
.page-footer { margin-top: 18px; text-align: center; }
.page-footer a { color: #405047; font-size: 14px; text-underline-offset: 3px; }
.history-page { max-width: 960px; }
.history-panel { padding: 24px; background: #fff; border: 1px solid #dfe5dc; border-radius: 20px; }
.history-panel h2 { margin: 0; font-size: 22px; }
.table-scroll { overflow-x: auto; margin-top: 22px; }
table { width: 100%; min-width: 660px; border-collapse: collapse; font-size: 14px; text-align: left; }
th { padding: 12px; background: #f0f5ef; color: #405047; font-weight: 600; white-space: nowrap; }
td { padding: 16px 12px; border-bottom: 1px solid #dfe5dc; vertical-align: top; line-height: 1.5; }
td:nth-child(2) { min-width: 180px; max-width: 320px; white-space: pre-wrap; overflow-wrap: anywhere; }
td:first-child, td:nth-child(4) { min-width: 125px; }
.reprint { width: auto; min-height: 44px; padding: 10px 16px; border-radius: 8px; font-size: 14px; }
.empty-history { text-align: center; padding: 36px 12px; color: #647168; }
@media (hover: hover) {
  .category:hover, .deadline-shortcut:hover { background: #f0f5ef; }
  .category[aria-pressed="true"]:hover { background: #d7eddd; }
  .print:hover { background: #196d39; }
}
@media (max-width: 380px) {
  body { padding: 32px 16px; }
  form { padding: 22px 18px; }
  .history-panel { padding: 20px 14px; }
}

[hidden] { display: none !important; }
.auth-panel { padding: 28px; background: #fff; border: 1px solid #dfe5dc; border-radius: 20px; }
.auth-panel .status { margin: 0 0 18px; }
button:disabled { cursor: wait; opacity: 0.65; }

.job-status { display: block; margin-top: 4px; color: #58665e; }

.pagination { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 20px; border-top: 1px solid #dfe5dc; }
.pagination button { min-height: 44px; padding: 10px 18px; border: 1px solid #248448; border-radius: 10px; background: #248448; color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; transition: background 120ms, border-color 120ms; }
.pagination button:focus-visible { outline: 3px solid #a4d5b3; outline-offset: 3px; }
.pagination button:disabled { background: #eef2ec; border-color: #dfe5dc; color: #758078; opacity: 1; cursor: default; }
.pagination span { color: #58665e; font-size: 14px; white-space: nowrap; }
@media (hover: hover) {
  .pagination button:not(:disabled):hover { background: #196d39; border-color: #196d39; }
}
