:root {
    --ink: #18201f;
    --muted: #67736f;
    --line: #dde5e2;
    --soft-line: #edf1ef;
    --paper: #ffffff;
    --canvas: #f3f6f4;
    --accent: #176b5d;
    --accent-hover: #0f574c;
    --accent-soft: #e4f3ef;
    --amber: #bd7424;
    --amber-soft: #fbf0df;
    --danger: #ad4141;
    --danger-soft: #fbeaea;
    --shadow: 0 14px 38px rgba(24, 32, 31, 0.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { min-width: 320px; min-height: 100%; background: var(--canvas); }

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at 12% 0%, rgba(23, 107, 93, 0.08), transparent 28rem),
        var(--canvas);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 66px;
    padding: 0 28px;
    color: #f7faf9;
    background: rgba(23, 35, 33, 0.97);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
}

.brand { display: inline-flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand strong { display: block; font-size: 15px; letter-spacing: 0.01em; }
.brand small { display: block; margin-top: 2px; color: #95aaa4; font-size: 10px; letter-spacing: 0.12em; }
.brand-mark { position: relative; display: block; width: 34px; height: 34px; border: 1px solid #51736b; border-radius: 10px; }
.brand-mark i { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: #71c4b2; }
.brand-mark i:nth-child(1) { left: 7px; top: 14px; }
.brand-mark i:nth-child(2) { right: 7px; top: 7px; }
.brand-mark i:nth-child(3) { right: 7px; bottom: 7px; }
.brand-mark::before, .brand-mark::after { content: ""; position: absolute; left: 12px; width: 11px; height: 1px; background: #71c4b2; transform-origin: left center; }
.brand-mark::before { top: 16px; transform: rotate(-32deg); }
.brand-mark::after { top: 17px; transform: rotate(32deg); }

.top-actions { display: flex; align-items: center; gap: 12px; }
.engine-state { display: inline-flex; align-items: center; gap: 7px; color: #c8d5d2; font-size: 11px; }
.engine-state i { width: 7px; height: 7px; border-radius: 50%; background: #6ac3af; box-shadow: 0 0 8px rgba(106, 195, 175, 0.8); }
.engine-state.checking i { background: #d8a35e; box-shadow: none; }
.engine-state.offline i { background: #df7777; box-shadow: none; }
.nav-button { padding: 8px 12px; color: #e8f0ee; border: 1px solid #3f5651; border-radius: 8px; font-size: 12px; font-weight: 650; text-decoration: none; }
.nav-button:hover { border-color: #718982; background: rgba(255, 255, 255, 0.05); }

.page-shell { width: min(1240px, calc(100% - 40px)); margin: 0 auto; padding: 42px 0 56px; }
.intro { display: flex; align-items: flex-end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.eyebrow { color: var(--accent); font-size: 10px; font-weight: 800; letter-spacing: 0.16em; }
.intro h1 { margin: 7px 0 7px; font-size: clamp(26px, 3.3vw, 42px); line-height: 1.12; letter-spacing: -0.035em; }
.intro p { max-width: 650px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }

.dashboard-grid { display: grid; grid-template-columns: minmax(340px, 0.92fr) minmax(380px, 1.08fr); gap: 18px; align-items: start; }
.panel { overflow: hidden; background: rgba(255, 255, 255, 0.96); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.panel-header { display: flex; align-items: center; gap: 12px; min-height: 78px; padding: 18px 20px; border-bottom: 1px solid var(--soft-line); }
.panel-header h2 { margin: 0; font-size: 15px; line-height: 1.3; }
.panel-header p { margin: 4px 0 0; color: #84908c; font-size: 11px; }
.step-number { display: grid; place-items: center; flex: 0 0 auto; width: 36px; height: 36px; color: var(--accent); background: var(--accent-soft); border-radius: 10px; font-size: 10px; font-weight: 850; letter-spacing: 0.07em; }
.tasks-panel { grid-column: 1 / -1; }
.task-header { align-items: center; }
.task-filters { display: flex; align-items: center; gap: 9px; margin-left: auto; }
.task-filters > input { width: 190px; }
.log-panel { grid-column: 1 / -1; }
.log-panel .panel-header .text-button { margin-left: auto; }

.form-stack { display: grid; gap: 17px; padding: 20px; }
.field { display: grid; gap: 7px; color: #4d5a56; font-size: 11px; font-weight: 700; }
.field small { color: #89948f; font-size: 10px; font-weight: 450; line-height: 1.55; }
.field small.validation-error { color: var(--danger); font-weight: 700; }
code { padding: 1px 4px; color: #42635b; background: #eef3f1; border-radius: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

input, select, textarea {
    width: 100%;
    color: var(--ink);
    background: #fbfcfb;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    transition: 150ms ease;
}

input, select { height: 40px; padding: 0 11px; }
textarea { padding: 11px; resize: vertical; line-height: 1.55; }
#variables-json, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 11px; }
input:focus, select:focus, textarea:focus { background: white; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.input-action { display: flex; }
.input-action input { border-radius: 8px 0 0 8px; }
.input-action button { flex: 0 0 auto; padding: 0 11px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--line); border-left: 0; border-radius: 0 8px 8px 0; cursor: pointer; font-size: 10px; font-weight: 750; }

.primary-button, .quiet-button, .text-button, .decision-button, .danger-button, .operation-button { cursor: pointer; transition: 150ms ease; }
.primary-button { min-height: 42px; color: white; background: var(--accent); border: 1px solid var(--accent); border-radius: 8px; font-size: 12px; font-weight: 750; box-shadow: 0 5px 14px rgba(23, 107, 93, 0.18); }
.primary-button:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.primary-button:disabled, .quiet-button:disabled, .decision-button:disabled, .danger-button:disabled, .operation-button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.quiet-button { min-height: 36px; padding: 0 12px; color: #42504c; background: white; border: 1px solid var(--line); border-radius: 8px; font-size: 11px; font-weight: 700; }
.quiet-button:hover { color: var(--accent); border-color: #a9bbb5; background: #fbfdfc; }
.text-button { padding: 4px; color: var(--accent); background: transparent; border: 0; font-size: 10px; font-weight: 750; }
.text-button:hover { text-decoration: underline; }

.lookup-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; padding: 18px 20px 0; }
.empty-state { display: grid; justify-items: center; padding: 62px 24px; color: #86918d; text-align: center; }
.empty-state.compact { padding: 38px 24px; }
.empty-state > span { display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 10px; color: var(--accent); background: var(--accent-soft); border-radius: 50%; font-size: 16px; }
.empty-state strong { color: #4b5854; font-size: 12px; }
.empty-state p { margin: 6px 0 0; font-size: 10px; line-height: 1.5; }
.instance-content { padding: 18px 20px 20px; }
.status-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.status-badge { padding: 5px 8px; color: var(--accent); background: var(--accent-soft); border-radius: 6px; font-size: 9px; font-weight: 850; letter-spacing: 0.09em; }
.status-badge.completed { color: #4f5a57; background: #e9edeb; }
.status-badge.withdrawn { color: var(--amber); background: var(--amber-soft); }
.status-badge.timeout { color: #9a6700; background: #fff2c7; }
.status-badge.timeout-rejected { color: #b42318; background: #fee4e2; }
.detail-list { display: grid; gap: 0; margin: 0; border: 1px solid var(--soft-line); border-radius: 9px; }
.detail-list div { display: grid; grid-template-columns: 88px 1fr; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--soft-line); }
.detail-list div:last-child { border-bottom: 0; }
.detail-list dt { color: #87918e; font-size: 10px; }
.detail-list dd { min-width: 0; margin: 0; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10px; }
.variables-block { margin-top: 17px; }
.subheading { display: flex; justify-content: space-between; margin-bottom: 7px; color: #4b5754; font-size: 10px; font-weight: 750; }
.subheading small { color: #8b9692; font-weight: 500; }
.instance-operations { margin-top: 17px; padding: 12px; background: #fbfcfb; border: 1px solid var(--soft-line); border-radius: 9px; }
.operation-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.operation-chip { padding: 5px 7px; color: #89938f; background: #f0f3f2; border-radius: 5px; font-size: 8px; font-weight: 750; }
.operation-chip.enabled { color: var(--accent); background: var(--accent-soft); }
.withdraw-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; margin-top: 10px; }
.withdraw-row input { height: 36px; }
.danger-button { min-height: 36px; padding: 0 12px; color: var(--danger); background: var(--danger-soft); border: 1px solid #efcaca; border-radius: 7px; font-size: 10px; font-weight: 800; }
.danger-button:hover:not(:disabled) { color: white; background: var(--danger); border-color: var(--danger); }
.operation-hint { margin: 8px 0 0; color: #87928e; font-size: 9px; line-height: 1.5; }
.approval-history { margin-top: 17px; }
.approval-timeline { display: grid; gap: 0; margin: 0; padding: 2px 0 0; list-style: none; }
.approval-step { position: relative; display: grid; grid-template-columns: 26px 1fr; gap: 9px; padding-bottom: 12px; }
.approval-step:last-child { padding-bottom: 0; }
.approval-step:not(:last-child)::before { content: ""; position: absolute; left: 12px; top: 25px; bottom: 0; width: 1px; background: #dce5e2; }
.approval-marker { position: relative; z-index: 1; display: grid; place-items: center; width: 25px; height: 25px; color: #78847f; background: #edf1ef; border: 3px solid white; border-radius: 50%; box-shadow: 0 0 0 1px #dce5e2; font-size: 10px; font-weight: 900; }
.approval-step.approved .approval-marker { color: white; background: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.approval-step.rejected .approval-marker { color: white; background: var(--danger); box-shadow: 0 0 0 1px var(--danger); }
.approval-step.pending .approval-marker { color: var(--amber); background: var(--amber-soft); box-shadow: 0 0 0 1px #e7c899; font-size: 17px; }
.approval-step.cancelled .approval-marker { color: #7f8985; background: #edf0ef; }
.approval-step-content { min-width: 0; padding: 10px 11px; background: #fbfcfb; border: 1px solid var(--soft-line); border-radius: 8px; }
.approval-step-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.approval-step-heading > div { min-width: 0; }
.approval-step-heading small { display: block; margin-bottom: 3px; color: #929c98; font-size: 7px; font-weight: 800; letter-spacing: 0.08em; }
.approval-step-heading strong { display: block; overflow: hidden; color: #34423e; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.approval-step-heading > span { flex: 0 0 auto; padding: 3px 6px; color: #5f6d68; background: #edf1ef; border-radius: 4px; font-size: 8px; font-weight: 800; }
.approval-step.approved .approval-step-heading > span { color: var(--accent); background: var(--accent-soft); }
.approval-step.rejected .approval-step-heading > span { color: var(--danger); background: var(--danger-soft); }
.approval-step.pending .approval-step-heading > span { color: var(--amber); background: var(--amber-soft); }
.approval-step-meta { display: flex; flex-wrap: wrap; gap: 5px 9px; margin-top: 7px; color: #84908b; font-size: 8px; }
.approval-step-meta b { color: #5a6763; }
.approval-step-meta code { padding: 0; color: #89948f; background: transparent; }
.approval-step-content p { margin: 8px 0 0; padding-top: 7px; color: #596762; border-top: 1px dashed #e2e8e6; font-size: 9px; line-height: 1.55; overflow-wrap: anywhere; }
.approval-step-content p b { color: #7b8782; }
.approval-step-content p.empty-comment { color: #a0a9a5; }
.approval-empty { padding: 18px; color: #929c98; background: #f7f9f8; border: 1px dashed #dce5e2; border-radius: 8px; font-size: 9px; text-align: center; }
.extension-history { margin-top: 17px; }
.extension-operation-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.extension-operation-item { display: grid; grid-template-columns: 30px 1fr; gap: 9px; padding: 10px; background: #fbfcfb; border: 1px solid var(--soft-line); border-radius: 8px; }
.extension-operation-icon { display: grid; place-items: center; width: 28px; height: 28px; color: var(--accent); background: var(--accent-soft); border-radius: 8px; font-size: 13px; font-weight: 900; }
.extension-operation-item.withdraw .extension-operation-icon { color: var(--danger); background: var(--danger-soft); }
.extension-operation-item.add-sign .extension-operation-icon { color: var(--amber); background: var(--amber-soft); }
.extension-operation-item.resolve-sign .extension-operation-icon { color: #54635e; background: #e8edeb; }
.extension-operation-content { min-width: 0; }
.extension-operation-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.extension-operation-heading strong { color: #394843; font-size: 10px; }
.extension-operation-heading time { color: #919b97; font-size: 8px; white-space: nowrap; }
.extension-operation-node { margin-top: 5px; color: #74807c; font-size: 8px; }
.extension-operation-participants { display: flex; align-items: center; gap: 6px; margin-top: 6px; color: #89938f; font-size: 9px; }
.extension-operation-participants b { color: #56645f; }
.extension-operation-content p { margin: 7px 0 0; padding-top: 6px; color: #5e6b67; border-top: 1px dashed #e2e8e6; font-size: 9px; line-height: 1.5; overflow-wrap: anywhere; }
.extension-operation-content p b { color: #7c8783; }
.extension-operation-content p.empty-comment { color: #a0a9a5; }
pre { max-height: 210px; margin: 0; padding: 12px; overflow: auto; color: #32423e; background: #f5f8f6; border: 1px solid var(--soft-line); border-radius: 8px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }

.check-field { display: inline-flex; align-items: center; gap: 6px; color: #65716d; font-size: 10px; white-space: nowrap; }
.check-field input { width: 14px; height: 14px; accent-color: var(--accent); }
.task-list { display: grid; gap: 12px; padding: 16px 20px 20px; }
.task-card { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(250px, 1.25fr); grid-template-areas: "summary actions" "form form"; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: #fcfdfc; }
.task-summary { grid-area: summary; }
.task-title-row { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.task-title-row h3 { margin: 0; font-size: 13px; }
.task-chip { padding: 3px 6px; color: var(--accent); background: var(--accent-soft); border-radius: 5px; font-size: 8px; font-weight: 800; }
.task-chip.pending { color: var(--amber); background: var(--amber-soft); }
.task-chip.resubmit { color: #945f08; background: #fff0c8; }
.task-chip.fill { color: #225ca8; background: #e8f1ff; }
.task-meta { display: grid; gap: 6px; color: #77827e; font-size: 10px; }
.task-meta span { overflow-wrap: anywhere; }
.task-meta b { color: #4e5b57; font-weight: 700; }
.task-actions { grid-area: actions; display: grid; grid-template-columns: 1fr auto auto; gap: 8px; align-items: end; }
.task-actions.delegated { grid-template-columns: 1fr auto; }
.task-actions label { display: grid; gap: 5px; color: #697570; font-size: 9px; font-weight: 700; }
.task-actions input { height: 36px; }
.decision-button { height: 36px; padding: 0 13px; border-radius: 7px; font-size: 10px; font-weight: 800; }
.decision-button.approve { color: white; background: var(--accent); border: 1px solid var(--accent); }
.decision-button.reject { color: var(--danger); background: var(--danger-soft); border: 1px solid #efcaca; }
.decision-button.resolve-sign { color: white; background: var(--amber); border: 1px solid var(--amber); }
.decision-button.resubmit { color: white; background: #d88b0b; border: 1px solid #d88b0b; }
.decision-button.save-fill { color: #225ca8; background: #eef5ff; border: 1px solid #b9d1f3; }
.decision-button.submit-fill { color: white; background: #2869bd; border: 1px solid #2869bd; }
.decision-button:hover { transform: translateY(-1px); }
.task-secondary-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: flex-end; gap: 6px; padding-top: 3px; border-top: 1px dashed var(--soft-line); }
.task-secondary-actions > span { margin-right: auto; color: #8a9591; font-size: 9px; font-weight: 700; }
.task-secondary-actions small { color: #9aa39f; font-size: 9px; }
.operation-button { height: 30px; padding: 0 10px; color: var(--accent); background: white; border: 1px solid #bad0ca; border-radius: 6px; font-size: 9px; font-weight: 800; }
.operation-button:hover { background: var(--accent-soft); border-color: #8bb3a9; }
.task-form-data { grid-area: form; padding: 13px 14px 14px; background: #f6faf8; border: 1px solid #e3ece8; border-radius: 9px; }
.task-form-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.task-form-heading strong { color: #344641; font-size: 11px; }
.task-form-heading small { color: #7f8d88; font-size: 9px; font-weight: 650; }
.task-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0; }
.task-form-item { position: relative; min-width: 0; padding: 10px 11px; background: white; border: 1px solid var(--soft-line); border-radius: 8px; }
.task-form-item dt { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 7px; }
.task-form-item dt span { min-width: 0; overflow: hidden; color: #687570; font-size: 9px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.task-form-item dt code { flex: 0 1 auto; max-width: 48%; overflow: hidden; color: #83908b; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.task-form-item dd { min-height: 18px; margin: 0 0 7px; overflow: hidden; color: #263732; font-size: 11px; font-weight: 680; line-height: 1.55; overflow-wrap: anywhere; }
.task-form-item > small { display: inline-flex; padding: 2px 5px; color: var(--accent); background: var(--accent-soft); border-radius: 4px; font-size: 8px; }
.task-form-data.empty { display: block; }
.task-form-data.empty .task-form-heading { margin-bottom: 4px; }
.task-form-data.empty p { margin: 0; color: #899590; font-size: 10px; }
.resubmit-form { background: #fffaf0; border-color: #f0dfb5; }
.fill-form { background: #f5f9ff; border-color: #d5e4f7; }
.resubmit-form-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.resubmit-form-field { display: grid; gap: 6px; min-width: 0; color: #596762; font-size: 9px; font-weight: 700; }
.resubmit-form-field > span { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.resubmit-form-field b { margin-left: 2px; color: var(--danger); }
.resubmit-form-field code { max-width: 48%; overflow: hidden; color: #899590; font-size: 8px; font-weight: 500; text-overflow: ellipsis; white-space: nowrap; }
.resubmit-form-field input, .resubmit-form-field select, .resubmit-form-field textarea { width: 100%; min-height: 36px; padding: 8px 10px; color: #263732; background: white; border: 1px solid #decda5; border-radius: 7px; font: inherit; font-size: 10px; }
.resubmit-form-field textarea { min-height: 70px; resize: vertical; }
.resubmit-form-field small { color: #8b918e; font-size: 8px; font-weight: 500; }
.fill-form .resubmit-form-field input, .fill-form .resubmit-form-field select, .fill-form .resubmit-form-field textarea { border-color: #c6d9f1; }
.fill-readonly-value { min-height: 36px; padding: 9px 10px; color: #53625d; background: #edf2f0; border: 1px solid #dfe7e4; border-radius: 7px; font-size: 10px; font-weight: 600; overflow-wrap: anywhere; }

.activity-log { display: grid; gap: 0; max-height: 250px; margin: 0; padding: 0; overflow-y: auto; list-style: none; }
.activity-log li { display: grid; grid-template-columns: 72px 110px 1fr; gap: 12px; padding: 11px 20px; border-bottom: 1px solid var(--soft-line); font-size: 10px; line-height: 1.5; }
.activity-log li:last-child { border-bottom: 0; }
.activity-log time { color: #909a96; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.activity-log strong { color: #44514d; }
.activity-log span { color: #6e7975; overflow-wrap: anywhere; }
.activity-log .error strong { color: var(--danger); }
.activity-log .muted-log { display: block; color: #909a96; text-align: center; }

.toast-region { position: fixed; z-index: 40; right: 20px; bottom: 20px; display: grid; gap: 8px; width: min(360px, calc(100vw - 40px)); pointer-events: none; }
.toast { padding: 12px 14px; color: white; background: #1d2a27; border-radius: 9px; box-shadow: 0 12px 30px rgba(24, 32, 31, 0.22); font-size: 11px; line-height: 1.5; animation: toast-in 180ms ease-out; }
.toast.error { background: #843737; }

.operation-dialog { width: min(440px, calc(100vw - 30px)); padding: 0; color: var(--ink); background: white; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px rgba(24, 32, 31, 0.26); }
.operation-dialog::backdrop { background: rgba(21, 31, 29, 0.42); backdrop-filter: blur(2px); }
.operation-dialog form { display: grid; gap: 16px; padding: 20px; }
.operation-dialog header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.operation-dialog h2 { margin: 5px 0 0; font-size: 18px; }
.dialog-close { width: 30px; height: 30px; color: #74807c; background: #f3f6f4; border: 0; border-radius: 7px; cursor: pointer; font-size: 20px; line-height: 1; }
.dialog-description { margin: -5px 0 0; color: #707c78; font-size: 10px; line-height: 1.65; }
.operation-dialog footer { display: flex; justify-content: flex-end; gap: 8px; padding-top: 3px; }
.operation-dialog footer .primary-button { min-width: 88px; padding: 0 14px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 900px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .tasks-panel, .log-panel { grid-column: auto; }
    .task-header { flex-wrap: wrap; }
    .task-filters { width: 100%; margin-left: 48px; }
    .task-filters > input { flex: 1; width: auto; }
    .task-card { grid-template-columns: 1fr; grid-template-areas: "summary" "actions" "form"; }
    .task-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .resubmit-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
    .topbar { min-height: 58px; padding: 0 14px; }
    .brand small, .engine-state span { display: none; }
    .page-shell { width: min(100% - 22px, 1240px); padding: 28px 0 38px; }
    .intro { align-items: flex-start; }
    .intro .quiet-button { display: none; }
    .intro h1 { font-size: 27px; }
    .panel-header { padding: 15px; }
    .form-stack, .task-list, .instance-content { padding: 15px; }
    .lookup-row { padding: 15px 15px 0; }
    .task-filters { display: grid; grid-template-columns: 1fr auto; width: 100%; margin-left: 0; }
    .task-filters > input { grid-column: 1 / -1; }
    .task-actions { grid-template-columns: 1fr 1fr; }
    .task-actions label { grid-column: 1 / -1; }
    .task-actions.delegated { grid-template-columns: 1fr; }
    .task-secondary-actions { justify-content: flex-start; }
    .task-secondary-actions > span { display: none; }
    .task-form-grid { grid-template-columns: 1fr; }
    .resubmit-form-grid { grid-template-columns: 1fr; }
    .activity-log li { grid-template-columns: 62px 1fr; padding: 10px 15px; }
    .activity-log li span { grid-column: 1 / -1; }
}
