:root {
  color: #172a2a;
  background: #f5f7f2;
  font-family: 'Malgun Gothic', 'Apple SD Gothic Neo', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  --line: #d7e2d9;
  --ink-soft: #415852;
  --green: #1b5645;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
a { color: var(--green); }
button, input, select, textarea { font: inherit; color: inherit; }
button, select, input { min-height: 44px; }
button { padding: .55rem 1rem; border: 1px solid #bbcec1; border-radius: .6rem; background: #fff; cursor: pointer; }
button:hover:not(:disabled) { border-color: var(--green); }
button:disabled { opacity: .55; cursor: default; }
:focus-visible { outline: 3px solid #9a620b; outline-offset: 3px; }
input, select, textarea { width: 100%; padding: .6rem .7rem; border: 1px solid #bbcec1; border-radius: .55rem; background: #fff; }
fieldset { min-width: 0; margin: 1.15rem 0 0; padding: .75rem; border: 1px solid var(--line); border-radius: .6rem; }
legend { padding: 0 .25rem; font-weight: 700; }
label, .panel-heading { display: grid; gap: .35rem; font-weight: 650; }
label > :is(input, select), textarea { font-weight: 400; }
h1, h2, h3, p { margin: 0; }

.shell { width: min(100% - 2.5rem, 73rem); margin-inline: auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-row { display: flex; justify-content: space-between; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; color: inherit; font-size: 1.24rem; font-weight: 800; text-decoration: none; }
.brand small { color: var(--ink-soft); font-size: .85rem; }
.header-row nav { display: flex; gap: .9rem; flex-wrap: wrap; }
.header-row nav a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink-soft); text-decoration: none; font-weight: 700; }
.header-row nav a:hover { color: var(--green); text-decoration: underline; }
.skip { position: absolute; top: -10rem; left: 1rem; z-index: 1; padding: .7rem; background: #fff; }
.skip:focus { top: 1rem; }

main { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); padding-block: clamp(1.75rem, 4vw, 3.75rem); }
.section-heading { border-left: 4px solid #6e987b; padding-left: .75rem; margin-bottom: 1rem; }
.section-heading h1 { font-size: clamp(1.6rem, 4vw, 2.6rem); letter-spacing: -.045em; }
.section-heading h2 { font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -.04em; }
.record-layout { display: grid; grid-template-columns: minmax(18rem, .85fr) minmax(0, 1.15fr); gap: 1rem; }
.card { min-width: 0; padding: clamp(1rem, 3vw, 1.6rem); background: #fff; border: 1px solid var(--line); border-radius: .85rem; }
.card h2, .panel-heading { font-size: 1.15rem; margin-bottom: .85rem; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .2rem .9rem; max-height: 13rem; overflow: auto; }
.choices label { display: flex; align-items: center; gap: .55rem; min-height: 44px; font-weight: 400; overflow-wrap: anywhere; }
.choices input { flex: 0 0 auto; width: 1.1rem; min-height: 1.1rem; accent-color: var(--green); }
.form-actions { display: flex; align-items: center; gap: .6rem .85rem; flex-wrap: wrap; margin-top: 1rem; }
.primary { border-color: var(--green); background: var(--green); color: #fff; font-weight: 750; }
.primary:hover:not(:disabled) { background: #124335; }
.editor { display: flex; flex-direction: column; }
.editor textarea { min-height: 13rem; resize: vertical; flex: 1; line-height: 1.7; }
.status { color: var(--ink-soft); font-size: .9rem; overflow-wrap: anywhere; }
.status:not(:empty) { margin-top: .45rem; }
.form-actions .status { margin: 0; }

.hours-filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .85rem; }
.days-off .form-actions { margin-top: 0; }
.days-off input { width: auto; max-width: 100%; }
.date-list { display: flex; flex-wrap: wrap; gap: .5rem; padding: 0; margin: 0; list-style: none; }
.date-list:not(:empty) { margin-top: .7rem; }
.date-list li { display: flex; align-items: center; gap: .6rem; padding-inline: .65rem .2rem; border-radius: .6rem; background: #eff4ef; }
.date-list button { padding-inline: .6rem; }
.card h3 { font-size: 1rem; margin: 1.2rem 0 .5rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 32rem; border-collapse: collapse; }
th, td { padding: .5rem; text-align: left; border-bottom: 1px solid var(--line); }
thead { background: #eff4ef; }
thead th { font-weight: 700; }
tbody th { white-space: nowrap; }
td select { min-width: 5rem; }
.target-fields { grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr)); }
#hours-results { margin-top: 1rem; }
caption { text-align: left; font-weight: 750; margin-bottom: .4rem; }
.site-footer { padding-block: 1.25rem; border-top: 1px solid var(--line); background: #fff; }
.site-footer .shell { display: flex; gap: .5rem 1.25rem; flex-wrap: wrap; }

@media (max-width: 48rem) {
  .record-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 32rem) {
  .shell { width: calc(100% - 1.5rem); }
  .hours-filters { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 21rem) {
  .fields { grid-template-columns: minmax(0, 1fr); }
}
