:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  --canvas: #f5f6f2;
  --paper: #fff;
  --ink: #182720;
  --muted: #53665b;
  --soft: #edf1eb;
  --line: #e0e7df;
  --forest: #122d26;
  --forest-2: #1b4235;
  --lime: #d9efab;
  --accent: #245b44;
  --amber: #8c5410;
  --danger: #a83240;
  --radius: 17px;
  --shadow: 0 2px 6px rgb(20 42 31 / .035);
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 280px; background: var(--canvas); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; }
::selection { background: #d4edb6; color: var(--forest); }
:focus-visible { outline: 3px solid #58a47b; outline-offset: 3px; }
:disabled { cursor: wait; opacity: .6; }
.skip { position: fixed; z-index: 50; left: 10px; top: -70px; padding: 12px; color: white; background: var(--forest); border-radius: 8px; }
.skip:focus { top: 10px; }
.boot { min-height: 90vh; display: grid; justify-content: center; align-content: center; justify-items: center; gap: 12px; color: var(--muted); }
.boot img { width: 52px; height: 52px; }
.icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.layout { min-height: 100dvh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.sidebar {
  background: var(--forest);
  color: #f0f5ed;
  height: 100dvh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  padding: 25px 16px 16px;
  border-right: 1px solid #254639;
  overflow: auto;
}
.brand { display: flex; gap: 12px; align-items: center; padding: 0 8px; }
.brand img { width: 40px; height: 40px; border-radius: 12px; }
.brand strong { font-size: 23px; font-weight: 740; letter-spacing: -.7px; }
.brand small { display: block; margin-top: 0; color: #b9cbbf; font-size: 11px; }
.nav-caption {
  margin: 29px 11px 9px;
  color: #acc0b1;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.nav-link {
  display: flex;
  min-height: 44px;
  padding: 9px 12px;
  border-radius: 10px;
  gap: 10px;
  align-items: center;
  font-weight: 550;
  font-size: 14px;
  color: #cfdfd2;
}
.nav-link:hover { background: rgb(255 255 255 / .08); }
.nav-link[aria-current] { background: #294a3c; color: #f4ffe8; }
.nav-link[aria-current] .icon { color: #d7f4ac; }
.nav-link .nav-number { margin-left: auto; font-size: 11px; color: #c8ddc9; }
.company-link { min-height: 40px; padding: 7px 11px; }
.company-link span:last-child { text-overflow: ellipsis; white-space: nowrap; overflow: hidden; }
.sidebar-bottom { margin-top: auto; padding-top: 22px; }
.user-panel {
  display: flex; align-items: center; gap: 10px;
  border-top: 1px solid rgb(255 255 255 / .15); padding: 15px 4px 4px 5px;
}
.user-panel .user-text { min-width: 0; flex: 1; }
.user-panel strong, .user-panel small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-panel strong { font-size: 13px; }
.user-panel small { color: #aec6b7; margin-top: 3px; font-size: 11px; }
.avatar { display: inline-grid; width: 40px; height: 40px; place-items: center; border-radius: 12px; font-size: 14px; font-weight: 750; flex: 0 0 auto; }
.avatar.sm { width: 27px; height: 27px; border-radius: 8px; font-size: 10px; }
.avatar.user { width: 34px; height: 34px; border-radius: 50%; background: #d6edb0; color: #254833; font-size: 12px; }
.mint { background: #dfeddb; color: #2c5b44; }
.blue { background: #e0eaf7; color: #2c5275; }
.sand { background: #f4e9cf; color: #6f501d; }
.violet { background: #eae4f5; color: #594173; }
.frame { min-width: 0; }
.topbar {
  min-height: 64px; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 18px; align-items: center;
  padding: 9px clamp(20px, 3.1vw, 48px);
}
.breadcrumb, .top-actions { display: flex; gap: 10px; align-items: center; min-width: 0; font-size: 13px; }
.breadcrumb { color: var(--muted); }
.breadcrumb strong { color: var(--ink); font-weight: 650; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.breadcrumb .icon { width: 15px; height: 15px; }
.top-actions .today { color: var(--muted); white-space: nowrap; }
.preview-flag { border-radius: 7px; background: #f5ecd7; color: #714b1d; padding: 5px 8px; font-size: 11px; font-weight: 650; white-space: nowrap; }
.main { max-width: 1570px; margin: auto; padding: 29px clamp(20px, 3.1vw, 48px) 44px; min-width: 0; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 23px; }
.page-head h1 { font-size: clamp(30px, 3vw, 43px); margin: 0; letter-spacing: -.045em; line-height: 1.08; font-weight: 750; }
.page-head p { margin: 8px 0 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; flex-shrink: 0; }
.btn, .icon-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; border: 1px solid var(--line); border-radius: 9px; background: white;
  padding: 8px 13px; font-weight: 630; font-size: 13px; line-height: 1.15;
}
.btn .icon, .icon-btn .icon { width: 18px; height: 18px; }
.btn:hover, .icon-btn:hover { background: #ecf1ea; }
.btn.primary { background: var(--forest-2); color: #fff; border-color: var(--forest-2); }
.btn.primary:hover { background: #255742; }
.btn.soft { background: #e9f1e5; color: #234e3c; border-color: transparent; }
.btn.soft:hover { background: #dcebd8; }
.btn.danger { color: var(--danger); }
.btn.tiny { min-height: 36px; padding: 7px 10px; font-size: 12px; }
.icon-btn { width: 40px; padding: 0; flex: 0 0 auto; }
.icon-btn.bare { background: transparent; border-color: transparent; }
.icon-btn.bare:hover { background: rgb(122 148 132 / .15); }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 23px; }
.metric {
  position: relative; min-height: 134px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 15px 17px 14px; box-shadow: var(--shadow);
}
.metric.primary { background: #173e33; color: #fbfff8; border-color: #173e33; }
.metric.primary::after {
  content: ""; width: 155px; height: 155px; border-radius: 50%; pointer-events: none;
  position: absolute; bottom: -80px; right: -47px;
  background: repeating-radial-gradient(circle, transparent, transparent 8px, #87ae8f30 9px, transparent 10px, transparent 13px);
}
.metric-title { font-size: 12px; font-weight: 660; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.metric.primary .metric-title, .metric.primary .metric-note { color: #d5e8da; }
.metric-icon { display: inline-grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: var(--accent); background: #edf4e9; }
.metric-icon .icon { width: 15px; height: 15px; }
.metric.primary .metric-icon { color: #e3f5cb; background: #315747; }
.metric-icon.sand { color: #815414; background: #f7edd8; }
.metric-value { position: relative; z-index: 1; margin-top: 10px; font-size: clamp(19px, 2.2vw, 31px); line-height: 1.16; letter-spacing: -.035em; font-weight: 720; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.metric-value span { display: block; }
.metric-value span + span { font-size: .63em; margin-top: 3px; }
.metric-note { color: var(--muted); font-size: 11px; margin-top: 7px; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(240px, .93fr); align-items: start; gap: 17px; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0; }
.panel + .panel.single { margin-top: 18px; }
.panel-head { padding: 16px 18px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--line); }
.panel-head h2, .panel-head h3, .section-head h2 { margin: 0; font-size: 16px; font-weight: 720; letter-spacing: -.015em; }
.panel-head small { display: block; color: var(--muted); margin-top: 4px; font-size: 12px; }
.link { display: inline-flex; gap: 3px; align-items: center; color: var(--accent); font-size: 13px; font-weight: 650; }
.link:hover { text-decoration: underline; }
.link .icon { width: 15px; height: 15px; }
.panel-foot { padding: 12px 18px; color: var(--muted); font-size: 12px; line-height: 1.45; }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 11px; }
.table-wrap { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th { background: #f7f9f5; color: var(--muted); font-size: 11px; font-weight: 650; text-align: left; white-space: nowrap; }
th, td { padding: 11px 17px; border-bottom: 1px solid var(--line); }
tr:last-child td { border-bottom: none; }
td small { display: block; color: var(--muted); font-size: 11px; line-height: 1.4; margin-top: 3px; }
tbody tr:hover { background: #f8faf7; }
.cell-main { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 650; }
.cell-main span:nth-child(2) { min-width: 0; }
.cell-main:hover { color: #287150; }
.quantity, .currency { white-space: nowrap; font-variant-numeric: tabular-nums; }
.status {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px;
  border-radius: 20px; font-size: 11px; font-weight: 650; line-height: 1.05;
  background: #edf0ec; color: #4d6355; white-space: nowrap;
}
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.done { background: #e6f2e2; color: #2d633e; }
.status.active { background: #e5edf9; color: #315e85; }
.status.waiting { background: #fbefd9; color: #795314; }
.status.failed { background: #fae9e8; color: #a23b45; }
.status-counts { padding: 8px 16px 12px; }
.count-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 4px; font-size: 13px; border-bottom: 1px solid #edf0eb; }
.count-line:last-child { border: 0; }
.count-line:hover { color: var(--accent); }
.count-line b { font-variant-numeric: tabular-nums; }
.empty { padding: 27px 20px; display: grid; justify-items: center; gap: 8px; text-align: center; }
.empty > .icon { color: #49765a; width: 32px; height: 32px; padding: 5px; background: #e9f1e5; border-radius: 9px; }
.empty h3 { margin: 4px 0 0; font-size: 15px; }
.empty p { margin: 0; color: var(--muted); max-width: 420px; font-size: 13px; line-height: 1.55; }
.empty .btn { margin-top: 4px; }
.company-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(245px, 1fr)); gap: 15px; }
.company-card { padding: 19px; display: grid; gap: 13px; }
.company-card .cell-main { gap: 12px; }
.company-card h2 { font-size: 17px; margin: 0; }
.company-card p { color: var(--muted); margin: 3px 0 0; line-height: 1.4; font-size: 12px; }
.company-card .summary { display: flex; justify-content: space-between; gap: 12px; padding-top: 13px; border-top: 1px solid var(--line); font-size: 13px; }
.company-card .summary span { color: var(--muted); }
.tabs { display: flex; gap: 5px; overflow: auto; margin: -3px 0 20px; border-bottom: 1px solid #dce5da; scrollbar-width: thin; }
.tab { display: flex; gap: 7px; align-items: center; padding: 10px 13px 12px; min-height: 45px; border-bottom: 2px solid transparent; color: var(--muted); font-size: 13px; font-weight: 640; white-space: nowrap; }
.tab[aria-current] { border-bottom-color: #35775b; color: #214b38; }
.tab .icon { width: 16px; height: 16px; }
.company-title { display: flex; align-items: center; gap: 13px; }
.company-title .avatar { height: 52px; width: 52px; font-size: 20px; border-radius: 15px; }
.source-note { margin: 0 0 15px; display: flex; align-items: center; gap: 7px; color: var(--muted); line-height: 1.4; font-size: 12px; }
.source-note .icon { width: 16px; height: 16px; }
.task-toolbar { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; padding: 13px 17px; border-bottom: 1px solid var(--line); }
.task-toolbar label { min-width: 140px; }
.task-toolbar .search { flex: 1; }
.job-open { border: 0; background: transparent; padding: 0; font-weight: 640; text-align: left; }
.job-open:hover { color: var(--accent); text-decoration: underline; }
.padded, .form-body { padding: 17px 19px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px 15px; }
.form-grid .wide { grid-column: 1 / -1; }
label.field { display: grid; gap: 5px; min-width: 0; }
.field > span, .field-label { color: #385345; font-size: 12px; font-weight: 650; }
input, select, textarea {
  width: 100%; min-width: 0; min-height: 44px; padding: 9px 11px;
  background: #fff; color: var(--ink); border: 1px solid #ccd9cd; border-radius: 8px;
}
input::placeholder, textarea::placeholder { color: #708276; }
textarea { resize: vertical; }
input[readonly] { background: #eff3ee; }
.form-block + .form-block { margin-top: 15px; }
.form-block h2 { margin: 0 0 12px; font-size: 16px; }
.form-block p, .body-copy { color: var(--muted); margin: 0 0 13px; font-size: 13px; line-height: 1.6; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 10px; padding-top: 16px; }
.form-error { align-self: center; color: var(--danger); font-size: 13px; margin: 6px 0 0; line-height: 1.5; }
.form-error:empty { display: none; }
.accounts { display: grid; gap: 10px; }
.account { padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #f7f9f5; }
.account-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; }
.form-toolbar { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.wallet-card { background: #173e33; color: #fff; padding: 20px; border-color: #173e33; }
.wallet-card h2 { font-size: 14px; margin: 0; color: #d6e8d9; }
.wallet-card strong { font-size: clamp(31px, 5vw, 45px); display: block; margin: 7px 0 14px; letter-spacing: -.04em; overflow-wrap: anywhere; }
.wallet-card .btn { color: var(--forest); background: var(--lime); border: 0; }
.wallet-card .btn:hover { background: #e8f6d1; }
.info { color: #365746; background: #edf4e9; border: 1px solid #dbe8d7; padding: 12px 13px; border-radius: 10px; font-size: 13px; line-height: 1.5; }
.key-info { display: flex; gap: 12px; align-items: center; padding: 14px; border-radius: 11px; background: #eef4ea; overflow-wrap: anywhere; margin-bottom: 13px; }
.key-info small { color: var(--muted); display: block; margin-top: 4px; }
.actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 14px; }
.mobile-bar, .mobile-brand, .mobile-status, .compact-company { display: none; }
.auth-wrap { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.auth-aside {
  display: flex; flex-direction: column; justify-content: space-between; min-height: 100%;
  padding: clamp(26px,5vw,70px); background: #173b31;
  background-image: radial-gradient(ellipse at 88% 100%, #345641, transparent 58%);
  color: #fafcf5; gap: 34px;
}
.auth-aside .brand { padding: 0; }
.auth-aside h1 { font-size: clamp(34px, 4.8vw, 67px); line-height: 1.02; letter-spacing: -.05em; max-width: 620px; margin: 0 0 16px; }
.auth-aside p { max-width: 420px; color: #d0e2d2; font-size: 16px; line-height: 1.6; }
.auth-aside .auth-features { display: flex; flex-wrap: wrap; gap: 9px; }
.auth-aside .auth-features span { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; padding: 8px 12px; border: 1px solid #547968; border-radius: 100px; }
.auth-aside .auth-features .icon { width: 16px; height: 16px; }
.auth-content { padding: 25px; display: grid; place-items: center; }
.auth-form { width: min(100%, 420px); padding: clamp(0px, 2vw, 18px); }
.auth-form h2 { font-size: 34px; letter-spacing: -.04em; margin: 0 0 6px; }
.auth-form > p { margin: 0 0 20px; color: var(--muted); font-size: 14px; line-height: 1.5; }
.auth-form .field { margin-bottom: 13px; }
.auth-form .btn.primary { width: 100%; margin-top: 10px; min-height: 46px; }
.auth-form .auth-switch { margin: 15px 0 0; }
dialog {
  width: min(calc(100% - 24px), 580px); max-height: calc(100dvh - 30px); overflow: auto; 
  border: 1px solid var(--line); border-radius: 17px; padding: 0; color: var(--ink); background: #fff;
  box-shadow: 0 24px 100px #14291e35;
}
dialog::backdrop { background: rgb(13 29 21 / .52); backdrop-filter: blur(2px); }
.dialog-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 15px 18px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { padding: 0; margin: 0; font-size: 19px; }
.dialog-body { padding: 17px 18px 20px; }
dialog[open][data-task-id] { display: flex; flex-direction: column; overflow: hidden; }
dialog[data-task-id] > .dialog-head { flex: none; }
dialog[data-task-id] > .dialog-body {
  min-height: 0; margin: 8px 6px; padding: 9px 12px 12px;
  overflow: auto; overscroll-behavior-y: contain; scrollbar-width: thin; scrollbar-color: #84978c transparent;
}
.job-detail { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; font-size: 14px; margin: 16px 0 0; }
.task-status { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.task-messages { display: grid; gap: 9px; margin: 0 0 15px; }
.task-message { min-width: 0; padding: 11px 13px; border: 1px solid var(--line); border-radius: 10px; }
.task-message.user-message { background: #f3f7ef; }
.task-message strong { font-size: 12px; color: var(--muted); }
.task-message .job-detail { margin-top: 4px; }
.task-files { display: grid; gap: 8px; margin: 13px 0; overflow-wrap: anywhere; }
.task-files-caption { font-size: 12px; color: var(--muted); }
.task-company-note { margin: 0 0 12px; color: var(--accent); font-weight: 650; font-size: 14px; }
.task-upload { margin-top: 12px; }
.task-upload-top { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; }
.task-upload-top small, .task-upload-list small, .task-message small { color: var(--muted); font-size: 12px; }
.task-upload-picker { position: relative; cursor: pointer; }
.task-upload-picker:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.task-upload-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.task-upload-list { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.task-upload-list li { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 5px 8px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; overflow-wrap: anywhere; }
.task-upload-list li > .icon { color: var(--accent); }
.task-upload-list small { display: block; }
.task-upload-status { margin: 7px 0 0; color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.task-upload-status:empty { display: none; }
[data-form="new-task"] > .field + .field { margin-top: 13px; }
.automation-head { align-items: center; flex-wrap: wrap; }
.automation-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 290px), 1fr)); gap: 14px; }
.automation-card { display: grid; gap: 14px; align-content: start; padding: 17px; }
.automation-card-head { display: flex; align-items: center; gap: 11px; min-width: 0; }
.automation-card-head .metric-icon { flex: none; width: 37px; height: 37px; }
.automation-card-head h3 { margin: 2px 0 0; font-size: 16px; line-height: 1.35; overflow-wrap: anywhere; }
.automation-card-head small, .automation-history-head small { color: var(--muted); font-size: 12px; }
.automation-system { background: linear-gradient(155deg, #f6f9f2 0%, #fff 62%); }
.automation-schedule { margin: 0; font-weight: 650; font-size: 14px; }
.automation-schedule small { color: var(--muted); display: block; margin-top: 5px; font-weight: 400; font-size: 12px; }
.automation-meta { margin: 0; padding: 12px 0 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.automation-meta dt { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.automation-meta dd { margin: 0; font-size: 13px; font-weight: 650; }
.automation-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.automation-form { display: grid; gap: 12px; }
.automation-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.automation-form [hidden], .template-description:empty { display: none; }
.template-description { margin: -6px 0 0; font-size: 12px; color: var(--muted); }
.automation-days { display: flex; flex-wrap: wrap; gap: 6px; }
.automation-days legend { color: var(--muted); font-size: 12px; margin-bottom: 7px; }
.automation-days label { display: inline-flex; align-items: center; gap: 5px; background: #f5f8f3; padding: 6px 7px; border-radius: 7px; font-size: 12px; }
.automation-days input { width: 14px; min-height: 14px; margin: 0; padding: 0; accent-color: var(--accent); }
.automation-history-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.automation-run { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.automation-run summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; padding: 12px; background: #f7f9f5; font-size: 13px; }
.automation-run summary::-webkit-details-marker { display: none; }
.automation-run summary .icon { margin-left: auto; color: var(--muted); }
.automation-run[open] summary .icon { transform: rotate(90deg); }
.automation-run-detail { padding: 14px; }
.automation-timeline { list-style: none; padding: 0; margin: 0; }
.automation-timeline li { position: relative; display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 5px 12px; padding: 0 0 16px 21px; font-size: 13px; line-height: 1.45; }
.automation-timeline li::before { content: ''; position: absolute; top: 5px; left: 2px; width: 8px; height: 8px; background: #c8d5c7; border: 1px solid #a1b4a2; border-radius: 50%; z-index: 1; }
.automation-timeline li::after { content: ''; position: absolute; top: 12px; bottom: -7px; left: 6px; border-left: 1px solid var(--line); }
.automation-timeline li:last-child::after { display: none; }
.automation-timeline li[data-step='running']::before { background: #4681a9; border-color: #4681a9; }
.automation-timeline li[data-step='completed']::before, .automation-timeline li[data-step='file-ready']::before, .automation-timeline li[data-step='snapshot-ready']::before { background: #40805b; border-color: #40805b; }
.automation-timeline li[data-step='waiting-input']::before, .automation-timeline li[data-step='waiting-approval']::before { background: #c58b35; border-color: #c58b35; }
.automation-timeline li[data-step='failed']::before, .automation-timeline li[data-step='snapshot-failed']::before { background: var(--danger); border-color: var(--danger); }
.automation-timeline time { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; white-space: nowrap; }
.automation-result { margin: 0 0 12px; background: #f5f8f2; border-radius: 9px; padding: 10px 12px; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.automation-file { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: 9px; align-items: center; padding: 9px 11px; margin: 0 0 9px; border: 1px solid #d3e5d0; border-radius: 9px; color: var(--accent); font-size: 13px; font-weight: 650; overflow-wrap: anywhere; }
.automation-file:hover { background: #eff7ec; }
.automation-file small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-weight: 400; }
.automation-file .icon { width: 18px; height: 18px; }
.workspace-update {
  position: fixed; z-index: 55; inset: auto 20px 72px auto; max-width: calc(100% - 40px);
  align-items: center; gap: 12px; padding: 8px 9px 8px 14px;
  background: var(--paper); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 8px 25px #14362925; font-size: 13px;
}
.workspace-update:not([hidden]) { display: flex; }
.workspace-update p { margin: 0; }
.workspace-update .btn { flex: none; }
dialog > .workspace-update {
  position: static; flex: none; justify-content: space-between; max-width: none;
  margin: 8px 18px 0; background: var(--soft); box-shadow: none;
}
.toast {
  position: fixed; right: 20px; bottom: 18px; max-width: min(86vw,380px); z-index: 60;
  border-radius: 10px; padding: 11px 14px; color: white; background: #1d513b; line-height: 1.4;
  box-shadow: 0 8px 25px #14362933; font-size: 13px;
}
.toast:empty { display: none; }
.toast.error { background: #8f313b; }
@media (max-width: 1070px) {
  .layout { grid-template-columns: 200px minmax(0, 1fr); }
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .metrics { gap: 10px; }
  .metric { padding-inline: 11px; }
}
@media (max-width: 760px) {
  .layout { display: block; }
  .sidebar { display: none; }
  .main { padding: 20px 14px calc(83px + env(safe-area-inset-bottom)); }
  .topbar { padding-inline: 14px; min-height: 58px; }
  .mobile-brand { display: flex; align-items: center; gap: 7px; font-size: 19px; font-weight: 750; letter-spacing: -.045em; }
  .mobile-brand img { width: 31px; height: 31px; }
  .breadcrumb { display: none; }
  .mobile-bar {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 2px; position: fixed; z-index: 20;
    inset: auto 0 0; min-height: 58px; padding: 3px 4px calc(4px + env(safe-area-inset-bottom));
    background: #ffffff; border-top: 1px solid var(--line);
  }
  .mobile-bar .nav-link { font-size: 10px; padding: 4px 2px; text-align: center; gap: 4px; color: #4f6758; flex-direction: column; justify-content: center; min-height: 48px; }
  .mobile-bar .nav-link[aria-current] { background: #e9f1e5; color: var(--forest); }
  .mobile-bar .nav-link[aria-current] .icon { color: #245b44; }
  .mobile-status { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
  .mobile-status a { min-height: 32px; }
  .page-head { align-items: flex-start; margin-bottom: 16px; }
  .page-head h1 { font-size: 30px; }
  .page-head p { font-size: 12px; }
  .page-actions { gap: 6px; }
  .main .page-actions .btn { padding-inline: 9px; }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 15px; }
  .metric { min-height: 116px; padding: 12px; }
  .metric-title { font-size: 11px; gap: 5px; }
  .metric-value { font-size: 22px; }
  .panel-head { padding: 13px; }
  th, td { padding: 9px 11px; }
  .company-table th:nth-child(3), .company-table td:nth-child(3), .company-table th:nth-child(4), .company-table td:nth-child(4) { display: none; }
  .tasks-table th.when, .tasks-table td.when, .tasks-table .task-company { display: none; }
  .compact-company { display: inline; }
  .task-toolbar { padding: 11px; }
  .task-toolbar label { min-width: 115px; }
  .task-toolbar .search { min-width: 100%; }
  .padded, .form-body { padding: 13px; }
  .form-grid { gap: 9px 10px; }
  .form-grid .stretch-mobile { grid-column: 1 / -1; }
  input, select, textarea { font-size: 16px; }
  .tabs { margin-bottom: 14px; }
  .workspace-update { inset-inline: 14px; bottom: calc(123px + env(safe-area-inset-bottom)); max-width: none; justify-content: space-between; }
  .toast { bottom: calc(72px + env(safe-area-inset-bottom)); }
  .auth-wrap { display: block; }
  .auth-aside { min-height: 0; padding: 20px; gap: 15px; }
  .auth-aside h1 { font-size: 31px; margin-bottom: 0; }
  .auth-aside p, .auth-aside .auth-features { display: none; }
  .auth-content { padding: 23px 18px; }
}
@media (max-width: 430px) {
  .topbar { gap: 7px; }
  .top-actions { gap: 5px; }
  .top-actions .icon-btn { width: 39px; }
  .preview-flag { overflow: hidden; text-overflow: ellipsis; max-width: 39vw; }
  .top-actions .today { display: none; }
  .page-head:has(.page-actions) { flex-wrap: wrap; gap: 10px; }
  .page-head .page-actions { min-width: 100%; }
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .company-title .avatar { width: 42px; height: 42px; border-radius: 11px; font-size: 15px; }
  .company-title { gap: 9px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0s !important; transition-duration: 0s !important; }
}
