:root {
  --mi-red: #e94043;
  --mi-red-action: #be282d;
  --mi-red-hover: #a41e24;
  --mi-red-soft: #fff2f2;
  --mi-ink: #26262c;
  --mi-muted: #686871;
  --mi-border: #e7e7eb;
  --mi-surface: #fff;
  --mi-background: #f6f6f8;
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--mi-ink);
  background: var(--mi-background);
  font-size: 14px;
  font-synthesis: none;
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--mi-red-action); outline-offset: 4px; }
.skip-link { position: absolute; top: -80px; left: 20px; z-index: 10; padding: 12px; background: white; }
.skip-link:focus { top: 12px; }
.site-header { min-height: 96px; padding: 18px max(32px, calc((100vw - 1240px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 32px; background: var(--mi-surface); border-top: 3px solid var(--mi-red); border-bottom: 1px solid var(--mi-border); }
.brand { display: flex; gap: 14px; align-items: center; text-decoration: none; flex-shrink: 0; }
.brand img { object-fit: contain; width: 52px; height: 52px; }
.brand-name { display: flex; flex-direction: column; gap: 4px; }
.brand-name strong { font-size: 27px; font-weight: 700; letter-spacing: -.9px; line-height: 1; }
.brand-dot { color: var(--mi-red); }
.brand-name > span { font-size: 9px; letter-spacing: 1.7px; font-weight: 600; color: var(--mi-muted); }
nav { display: flex; gap: 32px; align-self: stretch; align-items: center; }
nav a { display: flex; align-items: center; height: 100%; position: relative; font-size: 13px; text-decoration: none; color: var(--mi-muted); }
nav a:hover { color: var(--mi-red-action); }
nav .nav-active { color: var(--mi-ink); font-weight: 600; }
nav .nav-active::after { content: ""; position: absolute; height: 3px; background: var(--mi-red); bottom: -19px; left: 0; right: 0; border-radius: 2px 2px 0 0; }
.access-badge { display: flex; align-items: center; gap: 8px; border: 1px solid var(--mi-border); padding: 7px 12px; border-radius: 30px; color: var(--mi-muted); font-size: 11px; white-space: nowrap; }
.access-badge > span { width: 6px; height: 6px; border-radius: 50%; background: #777780; }
main { max-width: 1304px; margin: 0 auto; padding: 26px 32px 0; }
.breadcrumb { display: flex; gap: 12px; align-items: center; font-size: 11px; color: var(--mi-muted); }
.breadcrumb > span:first-child { font-weight: 600; color: var(--mi-ink); }
.breadcrumb > span:nth-child(2) { color: #a0a0a8; }
.hero { padding: 40px 0 36px; display: flex; justify-content: space-between; align-items: center; gap: 36px; }
.eyebrow { margin: 0 0 16px; font-size: 10px; letter-spacing: 2px; font-weight: 700; color: var(--mi-red-action); display: flex; align-items: center; gap: 9px; }
.eyebrow > span { height: 6px; width: 6px; border-radius: 2px; background: var(--mi-red); }
h1 { margin: 0; font-size: clamp(30px, 3.5vw, 46px); font-weight: 650; line-height: 1.15; letter-spacing: -1.7px; }
h1 > span { color: var(--mi-muted); font-weight: 400; }
.intro { color: var(--mi-muted); font-size: 14px; line-height: 1.8; margin: 18px 0 0; }
.hero-note { display: flex; align-items: stretch; gap: 18px; min-width: 284px; }
.note-line { width: 3px; background: var(--mi-red); border-radius: 2px; margin: 5px 0; }
.hero-note p { margin: 0; font-size: 17px; line-height: 1.7; color: var(--mi-muted); }
.hero-note strong { color: var(--mi-ink); font-weight: 600; }
.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 284px; gap: 24px; align-items: start; }
.auth-gate { max-width: 560px; margin: 24px auto 80px; text-align: center; }
.auth-gate h2 { margin: 0 0 12px; }
.auth-gate p { color: var(--mi-muted); }
.auth-button { display: inline-block; background: var(--mi-red-action); color: #fff; padding: 12px 20px; border-radius: 6px; text-decoration: none; margin-top: 14px; }
.auth-button:hover { background: var(--mi-red-hover); }
.auth-user { display: flex; align-items: center; gap: 12px; font-size: 12px; }
.auth-user button { border: 1px solid var(--mi-border); background: #fff; border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.workspace-main { min-width: 0; }
.workspace.contractor-mode { grid-template-columns: minmax(0,1fr); }
.panel { background: var(--mi-surface); border: 1px solid var(--mi-border); border-radius: 12px; padding: 28px; margin-bottom: 22px; box-shadow: 0 3px 10px #24243003; scroll-margin-top: 24px; }
.panel-heading { display: flex; gap: 13px; align-items: center; margin-bottom: 26px; }
.step-number { width: 36px; height: 36px; flex: 0 0 36px; border-radius: 9px; background: var(--mi-red-soft); color: var(--mi-red-action); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.step-number.neutral { color: var(--mi-muted); background: var(--mi-background); font-size: 19px; }
h2 { margin: 0; font-size: 17px; letter-spacing: -.3px; font-weight: 650; }
.panel-heading p { color: var(--mi-muted); font-size: 12px; margin: 6px 0 0; line-height: 1.5; }
.file-badge { margin-left: auto; color: var(--mi-muted); font-size: 9px; white-space: nowrap; border: 1px solid var(--mi-border); border-radius: 4px; padding: 5px 7px; letter-spacing: .4px; }
.files { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 24px; }
.upload-card { background: #fdfcfc; border: 1px dashed #ccccd3; border-radius: 9px; padding: 18px; min-width: 0; transition: border-color .15s, background .15s; }
.upload-card:hover, .upload-card:focus-within { border-color: var(--mi-red-action); background: #fff8f8; }
.upload-top { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.file-icon { width: 30px; height: 32px; border: 1px solid #f0cdce; border-radius: 6px; background: var(--mi-red-soft); color: var(--mi-red-action); font-size: 19px; display: grid; place-items: center; }
.origin-label { color: var(--mi-muted); font-size: 9px; letter-spacing: 1px; font-weight: 600; }
.upload-card > strong { display: block; font-size: 17px; margin-bottom: 5px; }
.upload-description { font-size: 11px; color: var(--mi-muted); line-height: 1.5; }
input[type="file"] { display: block; width: 100%; min-width: 0; padding: 13px 0 10px; color: var(--mi-muted); font-size: 11px; text-overflow: ellipsis; }
input[type="file"]::file-selector-button { border: 1px solid #d7d7de; border-radius: 5px; color: var(--mi-ink); background: white; padding: 7px 9px; margin-right: 8px; cursor: pointer; font: inherit; font-weight: 600; }
small { color: var(--mi-muted); font-size: 10px; }
.date-field > label, details > label { display: block; font-size: 12px; font-weight: 600; margin-bottom: 10px; }
input[type="datetime-local"], input[type="password"] { display: block; width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid #d9d9e0; border-radius: 6px; color: var(--mi-ink); background: white; }
.date-field input { max-width: 305px; }
.hint { color: var(--mi-muted); font-size: 11px; line-height: 1.7; margin: 10px 0 0; }
.full-report { margin-top: 22px; padding: 16px; background: #f7f7f9; border: 1px solid #ededf1; border-radius: 8px; }
.check { display: flex; align-items: flex-start; gap: 11px; cursor: pointer; }
.check input { width: 16px; height: 16px; flex-shrink: 0; margin: 2px 0 0; accent-color: var(--mi-red-action); }
.check strong { display: block; font-size: 12px; font-weight: 600; margin-bottom: 5px; }
.check > span > span { color: var(--mi-muted); font-size: 11px; line-height: 1.6; }
.full-report .hint { margin-left: 27px; }
details { font-size: 11px; color: var(--mi-muted); margin-top: 20px; }
summary { cursor: pointer; padding: 5px 0; width: fit-content; }
details > label { margin-top: 16px; }
.panel-action { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 24px -28px -28px; padding: 20px 28px; border-top: 1px solid var(--mi-border); }
.panel-action > span { color: var(--mi-muted); font-size: 11px; }
button { padding: 12px 18px; border: 1px solid transparent; border-radius: 6px; background: var(--mi-red-action); color: white; cursor: pointer; font-size: 12px; font-weight: 600; transition: background .15s, border-color .15s; }
button:hover:not(:disabled) { background: var(--mi-red-hover); }
button span { margin-left: 20px; font-size: 16px; font-weight: 400; }
button:disabled { opacity: .5; cursor: wait; }
#apply.confirmed:disabled { opacity: 1; cursor: default; background: #337454; }
.inline-status { margin: 14px 0 0; padding: 12px 14px; border-radius: 6px; border: 1px solid #d6e6da; background: #f4faf5; color: #285c3f; font-size: 12px; line-height: 1.65; white-space: pre-line; }
.inline-status.progress { background: #f6f6f9; border-color: var(--mi-border); color: var(--mi-ink); }
.inline-status.error { background: var(--mi-red-soft); border-color: #ebc4c7; color: #991e24; }
.button-secondary { background: white; border-color: #d6d6dd; color: var(--mi-ink); }
.button-secondary:hover:not(:disabled) { background: var(--mi-red-soft); border-color: #edc4c5; color: var(--mi-red-action); }
.section-description { font-size: 12px; line-height: 1.8; color: var(--mi-muted); margin: -8px 0 18px; }
.guide { background: white; border: 1px solid var(--mi-border); border-radius: 12px; padding: 25px 22px; }
.guide .eyebrow { font-size: 9px; margin-bottom: 12px; }
.guide h2 { font-size: 21px; line-height: 1.35; font-weight: 600; }
.steps { list-style: none; margin: 28px 0 0; padding: 0; }
.steps li { display: flex; gap: 13px; margin-bottom: 25px; }
.steps li > span { width: 24px; height: 24px; flex: 0 0 24px; border: 1px solid #e5d4d5; border-radius: 50%; display: grid; place-items: center; font-size: 10px; font-weight: 600; color: var(--mi-red-action); background: #fffafa; }
.steps strong { display: block; font-size: 12px; font-weight: 600; padding-top: 3px; }
.steps p { font-size: 11px; line-height: 1.8; margin: 7px 0 0; color: var(--mi-muted); }
.guide-footer { border-top: 1px solid var(--mi-border); padding-top: 17px; font-size: 10px; color: var(--mi-muted); display: flex; align-items: center; gap: 7px; }
.guide-footer > span { font-size: 18px; }
.privacy-note { display: flex; gap: 12px; padding: 22px 8px; }
.privacy-mark { border: 1px solid #c7c7ce; height: 20px; width: 18px; flex: 0 0 18px; border-radius: 4px 4px 8px 8px; display: grid; place-items: center; color: var(--mi-muted); font-size: 10px; }
.privacy-note strong { font-size: 11px; font-weight: 600; }
.privacy-note p { font-size: 11px; color: var(--mi-muted); line-height: 1.8; margin: 7px 0 0; }
#cards article { padding: 20px; background: #fafafa; border: 1px solid var(--mi-border); border-left: 3px solid var(--mi-red); border-radius: 8px; margin-bottom: 16px; }
#cards h3 { margin: 0 0 18px; font-size: 15px; }
#cards dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px,1fr)); gap: 16px; margin: 0; }
dt { font-size: 10px; color: var(--mi-muted); }
dd { margin: 5px 0 0; font-size: 27px; font-weight: 600; }
#cards ul { margin-bottom: 0; padding-left: 17px; color: var(--mi-muted); font-size: 11px; line-height: 1.8; }
.change-details { margin-top: 18px; }
.change-details summary { font-size: 12px; font-weight: 600; color: var(--mi-red-action); }
.change-list { max-height: 420px; overflow: auto; margin-top: 12px; }
.change-person { padding: 12px 0; border-top: 1px solid var(--mi-border); font-size: 12px; }
.change-person strong { display: block; }
.change-person ul { margin: 7px 0 0; padding-left: 18px; font-size: 11px; line-height: 1.7; }
.history-item { display: block; width: 100%; text-align: left; margin-top: 9px; background: white; color: var(--mi-ink); border-color: var(--mi-border); }
.history-item:hover:not(:disabled) { background: var(--mi-red-soft); }
#candidates article { padding-top: 18px; margin-top: 18px; border-top: 1px solid var(--mi-border); }
#candidates p { font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
#message:empty { display: none; }
#message { border: 1px solid var(--mi-border); border-left: 3px solid var(--mi-red); background: white; border-radius: 6px; padding: 16px 18px; font-size: 13px; line-height: 1.7; }
#message.error { background: var(--mi-red-soft); color: #991e24; border-color: #ebc4c7; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.contractor-notice { padding: 15px 17px; border: 1px solid #ead9c1; border-radius: 7px; background: #fffaf1; color: #665237; font-size: 12px; line-height: 1.8; }
.contractor-toolbar { display: flex; gap: 14px; align-items: end; flex-wrap: wrap; margin-top: 23px; }
.contractor-toolbar > div:first-child { flex: 1 1 280px; }
.contractor-toolbar > div:nth-child(2) { flex: 0 1 160px; }
.contractor-toolbar label, .contractor-search label, .contractor-confirm-form > label:not(.check) { display: block; margin: 0 0 8px; color: var(--mi-ink); font-size: 12px; font-weight: 600; }
.contractor-toolbar input, .contractor-toolbar select, .contractor-search input, .contractor-confirm-form textarea { width: 100%; min-width: 0; border: 1px solid #d9d9e0; border-radius: 6px; padding: 11px 12px; background: white; color: var(--mi-ink); }
.contractor-confirm-form textarea { resize: vertical; line-height: 1.6; }
.contractor-table-wrap { margin-top: 20px; width: 100%; overflow-x: auto; border: 1px solid var(--mi-border); border-radius: 8px; }
.contractor-table { width: 100%; border-collapse: collapse; min-width: 650px; text-align: left; }
.contractor-table th { padding: 14px 15px; font-size: 11px; color: var(--mi-muted); background: #f8f8fa; font-weight: 600; }
.contractor-table td { padding: 16px 15px; font-size: 12px; border-top: 1px solid var(--mi-border); line-height: 1.7; overflow-wrap: anywhere; }
.contractor-table td:first-child { font-weight: 600; width: 28%; }
.contractor-table td:nth-last-child(-n+2) { white-space: nowrap; }
.contractor-table tbody tr:hover { background: #fdfafb; }
.contractor-row-action { padding: 8px 12px; }
.contractor-badge { display: inline-block; border-radius: 20px; padding: 4px 10px; font-size: 11px; font-weight: 600; }
.contractor-badge.active { background: #edf7ef; color: #285c3f; }
.contractor-badge.inactive { background: #fff2f2; color: #991e24; }
.contractor-badge.unknown { background: #f0f0f4; color: #686871; }
.contractor-heading { display: flex; justify-content: space-between; gap: 22px; align-items: start; margin-bottom: 20px; }
.contractor-heading button { flex-shrink: 0; }
.contractor-search { display: flex; align-items: end; flex-wrap: wrap; gap: 14px; }
.contractor-search > div { flex: 1 1 300px; }
.contractor-candidates { margin-top: 18px; }
.contractor-candidates article { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 16px 0; border-top: 1px solid var(--mi-border); }
.contractor-candidates p { font-size: 12px; line-height: 1.8; margin: 0; overflow-wrap: anywhere; }
.contractor-candidate-button { flex-shrink: 0; }
.contractor-confirm-form { margin-top: 24px; }
.contractor-confirm-form h3 { font-size: 15px; }
.contractor-confirm-form > p:not(.contractor-notice):not(.hint) { font-size: 13px; line-height: 1.8; overflow-wrap: anywhere; }
.contractor-check { margin: 18px 0; padding: 14px; background: var(--mi-background); border-radius: 7px; }
.contractor-history-list { max-height: 440px; overflow: auto; margin-top: 16px; }
.contractor-history-list article { padding: 16px 0; border-top: 1px solid var(--mi-border); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.contractor-history-list p { margin: 6px 0 0; color: var(--mi-muted); white-space: pre-line; }
footer { border-top: 1px solid var(--mi-border); padding: 24px 0; margin-top: 24px; display: flex; justify-content: space-between; gap: 20px; color: var(--mi-muted); font-size: 10px; line-height: 1.5; }
footer > span:first-child { letter-spacing: .6px; font-weight: 600; }
.footer-divider { margin: 0 10px; color: #b0b0b8; }
@media (max-width: 1000px) {
  .site-header { flex-wrap: wrap; }
  nav { order: 3; width: 100%; padding-top: 5px; }
  .workspace { grid-template-columns: minmax(0,1fr) 250px; gap: 18px; }
  .hero-note { min-width: 250px; }
  .panel { padding: 22px; }
  .panel-action { margin: 22px -22px -22px; padding: 18px 22px; flex-wrap: wrap; }
  .files { gap: 12px; }
  .upload-card { padding: 14px; }
  .upload-description { display: block; min-height: 33px; }
}
@media (max-width: 780px) {
  .site-header { padding: 15px 22px; min-height: 85px; gap: 24px; flex-wrap: wrap; }
  .brand img { width: 44px; height: 44px; }
  .brand-name strong { font-size: 24px; }
  .access-badge { margin-left: auto; }
  nav { order: 3; width: 100%; gap: 26px; padding-top: 5px; }
  nav a { font-size: 12px; }
  nav .nav-active::after { bottom: -16px; }
  main { padding: 24px 22px 0; }
  .hero { padding: 30px 0; }
  .hero-note { display: none; }
  .workspace { grid-template-columns: minmax(0,1fr); }
  aside { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
  .privacy-note { padding: 20px 10px; }
  .intro { font-size: 13px; }
}
@media (max-width: 480px) {
  main { padding: 20px 16px 0; }
  .site-header { padding: 14px 16px; gap: 20px; }
  h1 { font-size: 30px; letter-spacing: -1.2px; }
  .intro br { display: none; }
  .files { grid-template-columns: minmax(0,1fr); }
  .upload-card { padding: 18px; }
  .upload-top { margin-bottom: 12px; }
  .upload-description { min-height: 0; }
  .file-badge { display: none; }
  .panel { padding: 20px; }
  .panel-heading { gap: 10px; }
  h2 { font-size: 16px; }
  .panel-action { margin: 22px -20px -20px; padding: 18px 20px; gap: 14px; }
  .panel-action button { width: 100%; }
  .date-field input { max-width: 100%; }
  .full-report { padding: 13px; }
  .full-report .hint { margin-left: 0; }
  aside { grid-template-columns: minmax(0,1fr); gap: 0; }
  footer { flex-direction: column; gap: 8px; }
  nav { gap: 18px; flex-wrap: wrap; }
  .contractor-toolbar > div, .contractor-toolbar > div:nth-child(2), .contractor-toolbar > button { flex: 1 1 100%; }
  .contractor-heading { flex-direction: column; gap: 15px; }
  .contractor-search > button { width: 100%; }
  .contractor-candidates article { flex-direction: column; align-items: stretch; gap: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
