:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --bg2: #eef2f5;
  --panel: #ffffff;
  --panel2: #f8fafb;
  --text: #22303c;
  --muted: #5a6874;
  --green: #006db0;
  --green2: #075b90;
  --gold: #986700;
  --danger: #b63136;
  --border: #dce3e9;
  --shadow: rgba(34, 48, 60, .06);
  --input: #fff;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); line-height: 1.55; }
a { color: var(--green); text-underline-offset: .2em; }
a:hover { color: var(--green2); }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #006db0; outline-offset: 3px; }
.wrap { width: min(1240px, calc(100% - 48px)); margin: auto; }
.topbar { padding: 30px 0 24px; border-bottom: 1px solid var(--border); margin-bottom: 38px; }
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand-pair { display: flex; align-items: center; gap: 28px; text-decoration: none; max-width: 100%; }
.brand-logo { display: block; width: 230px; max-width: 100%; height: auto; object-fit: contain; }
.brand-logo-newbox { width: 210px; }
.brand-divider { height: 42px; width: 1px; background: var(--border); flex: 0 0 1px; }
.account-label, .access-label { font-size: .85rem; color: var(--muted); overflow-wrap: anywhere; }
.nav, .idml-subnav { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.nav { margin-top: 24px; }
.nav a, .idml-subnav a { display: inline-block; text-decoration: none; padding: 8px 11px; border-radius: 7px; font-size: .9rem; color: var(--text); }
.nav a:hover, .idml-subnav a:hover { background: #e5edf3; }
.nav a[aria-current="page"], .idml-subnav a[aria-current="page"] { background: #e5eff7; color: var(--green2); font-weight: 650; }
.idml-subnav { padding: 8px 0 18px; }
.idml-breadcrumb { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); margin: 0 0 16px; }
.idml-breadcrumb > * + *::before { content: '/'; color: var(--muted); margin-right: 8px; }
.hero { max-width: 920px; margin-bottom: 26px; }
h1 { font-size: clamp(2rem, 4vw, 3.5rem); line-height: 1.15; letter-spacing: -.035em; margin: 0 0 16px; overflow-wrap: anywhere; }
h2 { font-size: 1.45rem; line-height: 1.3; letter-spacing: -.02em; margin: 0 0 12px; }
h3 { font-size: 1.1rem; margin: 0 0 10px; }
p { margin: 0 0 14px; }
.highlight { color: var(--green); }
.lead { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--muted); }
.kicker { text-transform: uppercase; color: var(--green); font-size: .75rem; letter-spacing: .09em; font-weight: 750; margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 22px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.card { min-width: 0; padding: 26px; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; box-shadow: 0 3px 12px var(--shadow); }
.card p { color: var(--muted); }
.action-card { display: flex; flex-direction: column; }
.action-card .row-actions { margin-top: auto; padding-top: 16px; margin-bottom: 0; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.button, button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid var(--green); border-radius: 7px; background: var(--green); color: #fff; padding: 10px 15px; font-weight: 650; font-size: .9rem; cursor: pointer; text-decoration: none; }
.button:hover, button:hover { background: var(--green2); color: #fff; }
.button.secondary, button.secondary, .nav-button { background: #fff; border-color: var(--border); color: var(--text); }
.button.secondary:hover, button.secondary:hover { background: #edf3f7; }
.button.danger, button.danger { color: var(--danger); border-color: #e5babc; background: #fff5f5; }
button:disabled { background: #dee5eb; border-color: #dee5eb; color: #677683; cursor: not-allowed; }
.form, .form fieldset { display: grid; gap: 17px; }
.form fieldset { padding: 0; margin: 0; border: 0; min-width: 0; }
label { display: grid; gap: 7px; font-weight: 600; }
input, textarea, select { width: 100%; min-width: 0; border: 1px solid #bdcbd6; border-radius: 6px; background: var(--input); color: var(--text); padding: 10px 12px; }
input:disabled { background: #f5f7f9; }
textarea { resize: vertical; min-height: 100px; }
input[type="checkbox"], input[type="radio"] { width: auto; accent-color: var(--green); }
.checkbox-line { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.checkbox-line input { margin-top: 5px; }
.inline-form { display: inline; margin: 0; }
.badge { display: inline-flex; align-items: center; padding: 4px 9px; border: 1px solid var(--border); border-radius: 20px; background: #f4f7fa; color: var(--muted); font-size: .78rem; font-weight: 600; }
.status-ok { color: #24733f; }
.status-warn { color: var(--gold); }
.status-danger, .status-bad { color: var(--danger); }
.badge.status-ok { background: #edf7f0; border-color: #c8e6d1; color: #24733f; }
.badge.status-warn { background: #fff8e8; border-color: #e9d9a2; color: var(--gold); }
.badge.status-danger { background: #fff1f1; border-color: #eac9c9; color: var(--danger); }
.msg { padding: 14px 16px; margin: 14px 0 20px; background: #edf4fa; color: #32536c; border: 1px solid #d7e6f2; border-radius: 7px; }
.msg.error { background: #fff0f0; border-color: #efcece; color: var(--danger); }
.status-list { display: grid; gap: 9px; margin-top: 14px; }
.status-line { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); }
.status-line strong { color: var(--text); }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; vertical-align: top; padding: 11px 12px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); background: #f5f8fa; }
td .button { white-space: nowrap; }
pre { overflow: auto; padding: 14px; border: 1px solid var(--border); border-radius: 7px; background: #f8fafb; }
code { font-size: .9em; overflow-wrap: anywhere; }
.idml-archive-list { display: grid; gap: 18px; }
.idml-job-card { padding: 20px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.idml-job-card.active { border-color: #99bfdd; }
.idml-job-head { display: flex; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.idml-job-title { min-width: 0; flex: 1 1 300px; }
.idml-job-title h2, .idml-meta-value, .idml-tm-text { overflow-wrap: anywhere; }
.idml-job-id { font-size: .75rem; color: var(--muted); overflow-wrap: anywhere; }
.idml-job-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 16px; }
.idml-meta-item { border: 1px solid var(--border); border-radius: 7px; padding: 10px 12px; min-width: 0; }
.idml-meta-item strong { display: block; font-size: .75rem; margin-bottom: 4px; color: var(--muted); }
.idml-archive-actions { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.idml-progress-mini { background: #e4ecf2; height: 8px; border-radius: 10px; overflow: hidden; margin-top: 8px; }
.idml-progress-mini span { display: block; height: 100%; background: var(--green); }
.idml-tm-text { white-space: pre-wrap; }
.small-input { padding: 8px 10px; font-size: .875rem; }
.feature-list { padding-left: 20px; color: var(--muted); }
.feature-list li { margin-top: 12px; }
.secondary-links { display: flex; flex-wrap: wrap; gap: 22px; padding: 28px 0 8px; }
.secondary-links a { font-size: .9rem; }
.footer { padding: 26px 0 32px; margin-top: 40px; border-top: 1px solid var(--border); font-size: .8rem; color: var(--muted); }
.skip-link { position: absolute; left: 10px; top: -80px; z-index: 10; background: #fff; padding: 10px; }
.skip-link:focus { top: 10px; }
@media (max-width: 1000px) {
  .grid[style*="repeat(6,1fr)"] { grid-template-columns: repeat(3, minmax(0, 1fr)) !important; }
}
@media (max-width: 760px) {
  .wrap { width: calc(100% - 28px); }
  .topbar { padding-top: 22px; margin-bottom: 28px; }
  .brand-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .brand-pair { gap: 18px; width: 100%; }
  .brand-logo { width: min(42vw, 230px); }
  .brand-logo-newbox { width: min(38vw, 210px); }
  .brand-divider { height: 32px; }
  .grid, .grid.two { grid-template-columns: 1fr; }
  .grid[style*="repeat(6,1fr)"] { grid-template-columns: 1fr !important; }
  .card { padding: 20px; }
  .nav { gap: 3px; }
  .nav a { padding: 7px 9px; font-size: .85rem; }
}
@media print {
  body { background: #fff; }
  .nav, .idml-subnav, .row-actions, .skip-link { display: none; }
  .wrap { width: 100%; }
  .card { box-shadow: none; break-inside: avoid; }
  .brand-logo { height: auto; }
}

.account-panel { display: grid; gap: 10px; min-width: 0; max-width: 430px; }
.account-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: .85rem; }
.account-actions button { padding: 6px 10px; font-size: .85rem; }
.organization-label { font-size: .85rem; }
.organization-switch { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0; }
.organization-switch label { font-size: .85rem; }
.organization-switch select { width: auto; flex: 1 1 130px; padding: 6px 10px; }
.organization-switch button { padding: 6px 10px; }
.auth-card { max-width: 620px; margin-inline: auto; }
.auth-card h1 { font-size: clamp(1.8rem, 4vw, 2.4rem); }
.auth-secondary { margin: 20px 0 0; font-size: .9rem; }
@media (min-width: 761px) { .brand-pair { flex-shrink: 0; } }
@media (max-width: 1000px) and (min-width: 761px) {
  .brand-logo { width: 180px; }
  .brand-logo-newbox { width: 160px; }
  .brand-pair { gap: 18px; }
}
@media (max-width: 760px) { .account-panel { width: 100%; max-width: none; } }
@media print { .account-panel { display: none; } }
