:root {
  color-scheme: light;
  --paper: #f3f6f3;
  --surface: #fff;
  --ink: #172c24;
  --muted: #53665d;
  --accent: #21654d;
  --accent-hover: #174f3b;
  --tint: #e6f1e9;
  --line: #dbe5dc;
  --error: #9f3d31;
  --radius: 15px;
  --sidebar-width: 248px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font: 15px/1.5 "Inter", "Segoe UI", system-ui, sans-serif;
}
h1, h2, p { margin: 0; }
h1 { font-size: clamp(1.85rem, 4vw, 2.45rem); line-height: 1.14; letter-spacing: -.048em; }
h2 { font-size: 1.13rem; line-height: 1.3; letter-spacing: -.018em; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { opacity: .65; cursor: default; }
:focus-visible { outline: 3px solid #519479; outline-offset: 3px; }
.muted, .help { color: var(--muted); }
.help { font-size: .82rem; display: block; margin-top: 6px; line-height: 1.48; }
.field .help ul { padding-left: 1.1em; }
.skip { position: absolute; top: 10px; left: 10px; transform: translateY(-150%); z-index: 10; background: white; padding: .6em; }
.skip:focus { transform: translateY(0); }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  display: flex;
  flex-direction: column;
  gap: 27px;
  width: var(--sidebar-width);
  padding: 27px 17px 20px;
  background: #fcfdfb;
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; color: inherit; }
.sidebar > .brand { margin: 0 6px 9px; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 9px; object-fit: cover; flex: none; }
.brand strong { display: block; font-size: 1.09rem; font-weight: 750; letter-spacing: -.03em; }
.brand small { display: block; color: var(--muted); font-size: .79rem; }
.nav { display: grid; gap: 5px; }
.nav a {
  min-height: 45px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 560;
  color: var(--muted);
}
.nav a:hover, .nav a[aria-current] { background: var(--tint); color: var(--accent-hover); text-decoration: none; }
.nav a[aria-current] { font-weight: 700; }
.nav-symbol { width: 19px; flex: none; text-align: center; font-size: 1.12rem; line-height: 1; }
.account {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 17px 3px 0;
  display: flex;
  align-items: center;
  gap: 9px;
}
.account-mark { width: 33px; height: 33px; border-radius: 50%; background: var(--tint); color: var(--accent); font-weight: 750; display: grid; place-items: center; flex: none; }
.account-info { flex: 1; min-width: 0; }
.account-info strong { display: block; color: var(--ink); font-size: .89rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-info a { display: block; font-size: .76rem; }
.signout { background: transparent; border: 1px solid var(--line); border-radius: 8px; color: var(--accent); width: 36px; height: 36px; }
.signout:hover { background: var(--tint); }

.workspace {
  margin-left: var(--sidebar-width);
  width: min(calc(100% - var(--sidebar-width)), 1290px);
  padding: 37px clamp(24px, 4vw, 54px) 48px;
}
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 18px; margin-bottom: 26px; }
.page-heading p { color: var(--muted); margin-top: 9px; }
.detail-heading h1 { overflow-wrap: anywhere; }
.back-link { display: inline-block; margin-bottom: 11px; font-size: .88rem; }
.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 29%); align-items: start; gap: 21px; }
.main-column { display: grid; gap: 16px; min-width: 0; }
.panel { min-width: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 23px; }
.panel-heading { margin-bottom: 20px; }
.panel-heading p, .panel > p { color: var(--muted); margin-top: 6px; }
.run-guide h2 { margin-bottom: 12px; }
.format-list, .asset-list { list-style: none; padding: 0; margin: 0; }
.format-list li { display: flex; align-items: flex-start; gap: 10px; padding: 11px 0; }
.format-list p { color: var(--muted); margin-top: 2px; font-size: .83rem; line-height: 1.4; }
.format-mark { display: inline-grid; flex: none; place-items: center; width: 47px; min-height: 34px; border-radius: 6px; font-size: .68rem; font-weight: 780; letter-spacing: .045em; }
.sheet-mark { background: #e6f3e9; color: #215b41; }
.pdf-mark { background: #f9ede7; color: #8d4131; }
.guide-foot { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 7px; color: var(--muted); font-size: .84rem; }
.guide-foot small { display: block; margin-top: 8px; font-size: .77rem; }

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  min-height: 44px;
  padding: 9px 14px;
  font-size: .88rem;
  font-weight: 690;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
}
.button:hover { text-decoration: none; }
.button.primary { color: #fff; background: var(--accent); border-color: var(--accent); }
.button.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.secondary { color: var(--ink); background: white; border-color: var(--line); }
.button.outline { color: var(--accent-hover); border-color: #c5d8cc; background: #f9fcf9; }
.button.outline:hover, .button.secondary:hover { background: var(--tint); }
.button.small { padding: 7px 11px; min-height: 38px; }
.field label, legend { font-weight: 660; color: var(--ink); font-size: .92rem; }
.field label { display: block; margin-bottom: 5px; }
.field + .field { margin-top: 12px; }
input:not([type=checkbox], [type=radio], [type=file], [type=hidden]), select, textarea {
  width: 100%;
  min-height: 41px;
  padding: 8px 10px;
  border: 1px solid #cbd8ce;
  border-radius: 8px;
  background: white;
  color: var(--ink);
}
textarea { resize: vertical; }
input[type=checkbox] { accent-color: var(--accent); }
input[type=file] { max-width: 100%; width: 100%; color: var(--muted); font-size: .84rem; }
input[type=file]::file-selector-button {
  border: 1px solid #cbd8ce;
  background: white;
  border-radius: 7px;
  padding: 6px 10px;
  margin-right: 8px;
  color: var(--ink);
  font: inherit;
  font-weight: 620;
  cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--tint); }
fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 7px; }
.file-row {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px dashed #c3d8ca;
  background: #f8fbf8;
  border-radius: 9px;
  margin-bottom: 7px;
}
.file-label { font-size: .83rem; font-weight: 610; }
.remove-file {
  min-width: 34px;
  min-height: 34px;
  border: 0;
  border-radius: 7px;
  color: var(--accent-hover);
  background: transparent;
  font-size: 1.25rem;
}
.remove-file:hover { background: var(--tint); }
#add-xml { margin-top: 3px; min-height: 38px; }
.upload-hint { margin-top: 8px; }
.zip-section { margin-top: 15px; padding-top: 14px; border-top: 1px solid var(--line); }
.title-field { padding-top: 12px; border-top: 1px solid var(--line); }
.advanced { padding-block: 16px; }
.advanced summary { cursor: pointer; font-weight: 700; color: var(--accent-hover); }
.advanced[open] summary { margin-bottom: 10px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 16px; margin-top: 14px; }
.form-grid .field { min-width: 0; margin-top: 0; }
.rules { margin-top: 15px; }
.rules #id_rules { display: grid; grid-template-columns: 1fr 1fr; gap: 5px 10px; }
.rules label { cursor: pointer; font-size: .85rem; }
.submit-area { display: flex; align-items: center; padding-bottom: 10px; }
.submit-area .button { padding-inline: 18px; }

.filters { display: flex; align-items: end; gap: 11px; margin-bottom: 15px; padding: 14px; }
.filters .field { width: min(100%, 270px); margin-top: 0; }
.filters .field:nth-child(2) { width: min(100%, 180px); }
.filters > a { padding: 10px 3px; font-size: .87rem; }
.table-panel { overflow-x: auto; padding: 0; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--line); text-align: left; font-size: .88rem; }
th { background: #f5f8f4; color: var(--muted); font-weight: 650; }
tr:last-child td { border-bottom: 0; }
td time { white-space: nowrap; }
.record-link { color: var(--ink); font-weight: 650; overflow-wrap: anywhere; }
.record-link:hover { color: var(--accent); }
.status { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-radius: 20px; padding: 4px 9px; font-size: .76rem; font-weight: 720; }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.queued { background: #eef2ef; color: #53655b; }
.status.running { background: #fff4da; color: #795822; }
.status.succeeded { background: #e4f4e9; color: #226445; }
.status.failed { background: #fae9e4; color: #94382a; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 18px; margin-top: 18px; }
.empty { padding-block: 36px; text-align: center; }
.empty .button { margin-top: 15px; }
.notice, .error-banner { margin-bottom: 16px; padding: 12px 14px; border-radius: 9px; }
.notice { background: var(--tint); color: var(--accent-hover); border: 1px solid #cfe3d3; }
.error-banner, .errorlist { background: #fff1ed; color: var(--error); }
.error-banner { border: 1px solid #eed5cd; }
.error-banner p { margin-top: 4px; overflow-wrap: anywhere; white-space: pre-line; }
.errorlist { border-radius: 6px; list-style: none; font-size: .87rem; margin: 5px 0; padding: 6px 8px; }
.error-banner .errorlist { margin-bottom: 0; padding-left: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px; margin-bottom: 17px; }
.metrics .panel { padding: 16px; }
.metrics span { display: block; color: var(--muted); font-size: .8rem; }
.metrics strong { display: block; color: var(--accent-hover); font-size: 1.65rem; font-variant-numeric: tabular-nums; }
.asset-list li { display: flex; align-items: center; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.asset-list li:last-child { border: 0; padding-bottom: 0; }
.asset-list small { display: block; color: var(--muted); margin-top: 2px; }
.asset-list .button { margin-left: auto; flex: none; }
.filename, .job-id { overflow-wrap: anywhere; }
.facts { margin: 0; }
.facts > div { border-bottom: 1px solid var(--line); padding: 7px 0; }
.facts > div:last-child { border: 0; }
.facts dt { color: var(--muted); font-size: .8rem; }
.facts dd { margin: 1px 0 0; font-size: .9rem; }
.facts .job-id { font-size: .76rem; }

.narrow { max-width: 620px; }
.narrow .button { margin-top: 15px; }
.login-layout { display: grid; grid-template-columns: 1.07fr .93fr; align-items: center; min-height: 100vh; background: #f8faf6; }
.login-visual { min-height: 100vh; position: relative; color: white; background: #113529; }
.login-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.login-art-text {
  inset: 0;
  position: absolute;
  padding: clamp(24px, 6.4vw, 88px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(180deg, #05271fc9, #102c2122 43%, #061e19e8);
}
.login-art-text h1 { font-size: clamp(2.2rem, 4.4vw, 4.3rem); letter-spacing: -.052em; }
.login-art-text p { margin-top: 11px; color: #e2f2e5; }
.login-card { padding: 30px; max-width: 430px; width: 100%; margin: auto; }
.login-card h2 { font-size: 1.95rem; line-height: 1.15; }
.login-card p { margin: 8px 0 21px; }
.login-submit { width: 100%; justify-content: space-between; margin-top: 17px; }
.guest > .narrow { margin: 25px auto; }

@media (max-width: 1000px) {
  :root { --sidebar-width: 210px; }
  .workspace-grid { grid-template-columns: minmax(0, 1fr) minmax(208px, 30%); gap: 13px; }
  .panel { padding: 16px; }
  .table-panel { padding: 0; }
}
@media (max-width: 810px) {
  .sidebar { position: static; width: 100%; padding: 14px 17px 9px; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar > .brand { margin: 0; }
  .nav { grid-row: 2; grid-column: 1 / -1; display: flex; flex-wrap: wrap; }
  .nav a { min-height: 37px; padding-block: 7px; }
  .account { grid-row: 1; grid-column: 2; margin: 0; padding: 0; border: 0; }
  .workspace { margin-left: 0; width: 100%; padding: 23px 17px 36px; }
}
@media (max-width: 600px) {
  .workspace-grid, .form-grid, .rules #id_rules { grid-template-columns: 1fr; }
  .page-heading { align-items: flex-start; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; }
  .main-column { gap: 12px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .filters { flex-wrap: wrap; }
  .filters .field, .filters .field:nth-child(2) { flex: 1 1 135px; }
  .file-row { grid-template-columns: minmax(0, 1fr) auto; }
  .file-row label { grid-column: 1 / -1; }
  .login-layout { grid-template-columns: 1fr; }
  .login-visual { min-height: 330px; }
  .login-card { padding: 24px 22px 38px; }
  .account-mark { display: none; }
  .asset-list li { gap: 7px; }
}
@media (max-width: 380px) {
  .brand img { width: 33px; height: 33px; }
  .brand small { display: none; }
  .asset-list .format-mark { display: none; }
}
