:root {
  color-scheme: light;
  font-family: "Malgun Gothic", "Apple SD Gothic Neo", system-ui, sans-serif;
  line-height: 1.6;
  color: #182c35;
  background: #eef3f5;
  --accent: #175262;
  --stroke: #bfccd2;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { width: min(100% - 2rem, 60rem); margin: 2rem auto 4rem; }
a { color: var(--accent); }
.site-header {
  display: flex; justify-content: space-between; align-items: center; gap: 0.8rem;
  padding: 0.85rem max(1rem, calc((100% - 60rem) / 2)); background: #fff;
  border-bottom: 1px solid var(--stroke);
}
.brand { font-size: 1.06rem; text-decoration: none; color: inherit; font-weight: 750; }
.brand span { margin-inline-start: 0.5ch; color: #425f6b; font-size: 0.92em; }
h1 { margin: 0.2em 0 0.7em; line-height: 1.23; font-size: clamp(1.7rem, 4vw, 2.55rem); }
h2 { margin: 0 0 0.65em; font-size: 1.2rem; line-height: 1.3; }
p { margin: 0.65rem 0; }
.panel {
  background: #fff; border: 1px solid var(--stroke); border-radius: 0.95rem;
  padding: clamp(1rem, 3vw, 1.65rem); margin-bottom: 1rem;
}
.narrow { max-width: 33rem; margin-inline: auto; }
.actions, .signature-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.55rem; }
.signature-head { justify-content: space-between; margin-bottom: 0.55rem; }
.stack { display: grid; gap: 0.85rem; }
.stack p { margin: 0; }
button, .button {
  font: inherit; font-size: 0.95rem; font-weight: 700; text-align: center; text-decoration: none;
  color: #17313d; background: #fff; border: 1px solid var(--stroke); border-radius: 0.55rem;
  padding: 0.55em 0.9em; min-height: 44px; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer;
}
button:focus-visible, .button:focus-visible, input:focus-visible { outline: 3px solid #4685a1; outline-offset: 2px; }
button:disabled { color: #59686e; background: #e9eef0; cursor: default; }
button.primary:not(:disabled), .primary, .button[aria-current="page"] { background: var(--accent); border-color: var(--accent); color: #fff; }
button.small, .button.small { min-height: 40px; }
#name, input[type="password"] { width: 100%; min-height: 46px; border: 1px solid var(--stroke); padding: 0.7rem; border-radius: 0.5rem; font: inherit; }
input[type="checkbox"] { width: 1.35rem; height: 1.35rem; margin: 0.12rem 0 0; accent-color: var(--accent); }
.check { display: grid; grid-template-columns: 1.4rem 1fr; gap: 0.55rem; align-items: start; min-height: 44px; padding: 0.6rem 0 0.25rem; cursor: pointer; }
dl { margin: 0.8rem 0; }
dl > div { display: grid; grid-template-columns: minmax(6rem, 1fr) 2.3fr; gap: 1rem; padding: 0.5rem 0; border-bottom: 1px solid #e3eaee; }
dt { color: #435e69; }
dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
.authorization h2:not(:first-child) { margin-top: 1.35rem; }
.authorization p, .authorization li { white-space: pre-line; overflow-wrap: anywhere; }
.authorization li { margin-block: 0.35rem; }
.notice, .error { color: #ac231d; font-weight: 700; }
.error span { display: block; }
.error[role="alert"] { background: #fff0ed; border-left: 4px solid #ad2922; padding: 0.65rem; border-radius: 0.25rem; }
.signature-pad { position: relative; max-width: 42rem; margin-bottom: 0.6rem; }
#ink {
  width: 100%; display: block; aspect-ratio: 75 / 34; background: #f6f8f9;
  border: 1px solid #849ba7; border-radius: 0.65rem; touch-action: pan-y;
}
#ink.drawing { touch-action: none; background: #fff; outline: 3px solid #b3d3df; }
#ink-placeholder { inset: 50% 0 auto; position: absolute; text-align: center; pointer-events: none; color: #526b75; }
#signature-status { min-height: 1.2rem; color: #285463; }
#document-dialog {
  width: min(58rem, calc(100% - 1.25rem)); max-height: calc(100% - 1.25rem);
  padding: 0 0 1rem; border: 1px solid var(--stroke); border-radius: 0.65rem; overflow: auto;
}
#document-dialog::backdrop { background: rgb(13 27 34 / 66%); }
.viewer-header {
  position: sticky; top: 0; left: 0; display: flex; justify-content: space-between; align-items: center;
  gap: 1rem; padding: 0.55rem 0.85rem; border-bottom: 1px solid var(--stroke); background: #fff;
}
.viewer-header h2 { margin: 0; }
#viewer-close { color: #fff; background: #112833; }
.viewer-tools { justify-content: center; margin: 0.65rem 0; }
#viewer-image { width: 100%; height: auto; display: block; border-top: 1px solid var(--stroke); }
#viewer-image.zoomed { width: max(145%, 50rem); max-width: none; }
#preview-error { margin-inline: 0.7rem; }
.records { list-style: none; padding: 0; }
.records h2 { margin: 0.55em 0 0.3em; overflow-wrap: anywhere; }
.records p { font-size: 0.93rem; }
.status { font-weight: 700; color: #385c69; background: #e7f0f1; border-radius: 0.3rem; padding: 0.15rem 0.4rem; }
.programs { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.75rem; }
nav.actions { margin-bottom: 1rem; }
.cancel-request, .send-controls { margin-top: 1rem; }
@media (max-width: 34rem) {
  .admin-header { display: grid; justify-content: stretch; justify-items: start; }
  .admin-header .brand span { display: inline; }
}
@media (max-width: 450px) {
  main { margin-top: 1.25rem; }
  .brand span { display: block; }
  .signature-head .actions { gap: 0.35rem; }
  .signature-head button { padding-inline: 0.58rem; }
}


