/*
 * AMIR shell parity layer
 *
 * This file deliberately comes after style.css.  It normalises the shared
 * workspace shell to the Technical Precision Minimal tokens used by the
 * approved Stitch screens while leaving page data and behaviour untouched.
 */

:root {
  --bg: #fff;
  --surface: #fbf9f8;
  --ink: #1b1c1c;
  --muted: #444748;
  --line: #efeded;
  --button: #000;
  --button-text: #fff;
  --blue: #0057c0;
  --tint: #d8e2ff;
  --error: #ba1a1a;
  --success-bg: #ecfdf5;
  --success-text: #047857;
  --success-border: #a7f3d0;
  --warning-bg: #fffbeb;
  --warning-text: #a16207;
  --warning-border: #fde68a;
  --critical-bg: #ffdad6;
  --critical-text: #93000a;
  --critical-border: #fecaca;
  --neutral-bg: #efeded;
  --neutral-text: #444748;
  --neutral-border: #e4e2e2;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Consolas, monospace;
}

html {
  background: var(--surface);
}

body {
  background: var(--surface);
  color: var(--ink);
  font-family:
    Geist,
    Inter,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  font-size: 13px;
  line-height: 18px;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.app-shell {
  min-height: 100vh;
  background: var(--surface);
}

.app-shell h1 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 24px;
  font-weight: 600;
  line-height: 30px;
  letter-spacing: -0.025em;
}

.app-shell h2 {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  line-height: 22px;
  letter-spacing: -0.015em;
}

.app-shell h3 {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 18px;
}

.app-shell p {
  line-height: 1.5;
}

.app-shell .mono,
.app-shell .tnum,
.app-shell table,
.app-shell .badge {
  font-variant-numeric: tabular-nums;
}

/* Persistent desktop navigation: 256px, matching the Stitch shell. */
.app-shell > aside {
  width: 256px;
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.app-shell > aside > div:first-child > div:first-child {
  height: 64px;
  padding-inline: 24px;
  border-color: var(--line);
}

.app-shell > aside nav button {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 8px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
  line-height: 18px;
}

.app-shell > aside nav button:hover {
  filter: none;
  color: var(--ink);
  background: #efeded;
}

.app-shell > aside nav button[aria-current="page"] {
  color: var(--ink);
  background: #e9e8e7;
  border-color: #e9e8e7;
  font-weight: 500;
}

.app-shell > aside nav button .material-symbols-outlined {
  color: #747878;
}

.app-shell > aside > div:last-child {
  border-color: var(--line);
  background: #fff;
}

/* Fixed command bar. */
.app-shell > div > header {
  left: 256px;
  height: 64px;
  padding-inline: 24px;
  background: rgba(255, 255, 255, 0.92);
  border-color: var(--line);
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.04);
}

.app-shell > div > header > div {
  gap: 16px;
}

/* Workspace canvas and shared vertical rhythm. */
.app-shell main#main {
  min-height: 100vh;
  padding: 88px 24px 48px;
  background: var(--surface);
}

.app-shell main#main > :not(.footer-note) {
  width: 100%;
  max-width: 1184px;
  margin-inline: auto;
}

.app-shell .heading {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.app-shell .footer-note {
  max-width: 1184px;
  margin: 40px auto 0;
  padding-top: 20px;
  border-color: var(--line);
  font: 400 11px/14px var(--mono);
}

/* Technical controls: compact, square and consistent. */
.app-shell button,
.app-shell .file-link {
  min-height: 32px;
  padding: 6px 12px;
  border-color: #e4e2e2;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
  box-shadow: none;
}

.app-shell button:hover:not(:disabled),
.app-shell .file-link:hover {
  filter: none;
  background: #f5f3f3;
  border-color: #c4c7c7;
}

.app-shell button.primary,
.app-shell button.bg-primary {
  color: #fff;
  background: #000;
  border-color: #000;
}

.app-shell button.primary:hover:not(:disabled),
.app-shell button.bg-primary:hover:not(:disabled) {
  color: #fff;
  background: #1c1b1b;
  border-color: #1c1b1b;
}

.app-shell button:focus-visible,
.app-shell a:focus-visible,
.app-shell input:focus-visible,
.app-shell select:focus-visible,
.app-shell textarea:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

.app-shell input,
.app-shell select,
.app-shell textarea {
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid #e4e2e2;
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  line-height: 18px;
  box-shadow: none;
}

.app-shell textarea {
  min-height: 88px;
}

.app-shell input:focus,
.app-shell select:focus,
.app-shell textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px var(--blue);
}

.app-shell label {
  color: var(--ink);
  font-size: 12px;
  font-weight: 500;
  line-height: 16px;
}

.app-shell .field {
  gap: 6px;
}

.app-shell .fields {
  gap: 16px;
}

.app-shell form .actions,
.app-shell .actions-row {
  gap: 8px;
}

/* Shared surfaces. */
.app-shell .panel,
.app-shell .product-card,
.app-shell .kpi-card,
.app-shell .stat-card,
.app-shell .action-banner,
.app-shell .production-table-wrap,
.app-shell .table-panel,
.app-shell details.advanced,
.app-shell .context,
.app-shell .empty {
  border-color: var(--line);
  border-radius: 6px;
  background: #fff;
  box-shadow: none;
}

.app-shell .panel,
.app-shell .product-card {
  padding: 20px;
}

.app-shell .kpi-grid,
.app-shell .overview-stats {
  gap: 12px;
  margin-bottom: 24px;
}

.app-shell .kpi-card,
.app-shell .stat-card {
  padding: 16px;
}

.app-shell .kpi-card-value,
.app-shell .stat-card strong {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

.app-shell .badge {
  min-height: 20px;
  padding: 2px 6px;
  border-radius: 999px;
  font: 500 10px/14px var(--mono);
  letter-spacing: 0;
}

.app-shell .callout {
  padding: 12px;
  border-color: var(--line);
  border-radius: 4px;
  background: #f5f3f3;
  font-size: 12px;
  line-height: 18px;
}

.app-shell .action-banner {
  padding: 12px;
  gap: 12px;
}

.app-shell .action-banner-icon {
  border-radius: 4px;
}

.app-shell .empty {
  padding: 40px 20px;
  border-style: dashed;
  background: #f5f3f3;
}

/* Dense data tables from the Stitch reference. */
.app-shell .table-overflow,
.app-shell .production-table-wrap {
  overflow-x: auto;
}

.app-shell table {
  border-collapse: collapse;
  color: var(--ink);
}

.app-shell table th,
.app-shell .batch-list th,
.app-shell .production-table th {
  height: 32px;
  padding: 8px 12px;
  border-color: var(--line);
  background: #f5f3f3;
  color: var(--muted);
  font: 500 10px/14px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.app-shell table td,
.app-shell .batch-list td,
.app-shell .production-table td {
  padding: 8px 12px;
  border-color: var(--line);
  font-size: 12px;
  line-height: 16px;
}

.app-shell tbody tr:hover {
  background: rgba(245, 243, 243, 0.65);
}

/* Tablet: the Stitch design turns the full sidebar into a 56px icon rail. */
@media (min-width: 768px) and (max-width: 1023px) {
  .app-shell > aside.hidden {
    display: flex !important;
    width: 56px;
    overflow: hidden;
  }

  .app-shell > aside > div:first-child > div:first-child {
    height: 56px;
    padding: 12px;
  }

  .app-shell > aside > div:first-child > div:first-child > div,
  .app-shell > aside > div:first-child > div:nth-child(2) > div:first-child,
  .app-shell > aside nav button span:not(.material-symbols-outlined),
  .app-shell > aside nav button > div span:not(.material-symbols-outlined),
  .app-shell > aside nav > div > div,
  .app-shell > aside > div:last-child {
    display: none !important;
  }

  .app-shell > aside > div:first-child > div:nth-child(2) {
    padding: 8px;
  }

  .app-shell > aside nav button,
  .app-shell > aside nav > div > button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    justify-content: center;
    padding: 0;
  }

  .app-shell > aside nav button .material-symbols-outlined {
    margin: 0 !important;
  }

  .app-shell > div {
    padding-left: 56px;
  }

  .app-shell > div > header {
    left: 56px;
  }

  .app-shell > div > header .lg\:hidden {
    display: none !important;
  }

  .app-shell main#main > .lg\:hidden {
    display: none !important;
  }
}

/* Mobile: compact command bar and horizontal section navigation. */
@media (max-width: 767px) {
  .app-shell > div {
    padding-left: 0;
  }

  .app-shell > div > header {
    left: 0;
    height: 56px;
    padding-inline: 16px;
  }

  .app-shell main#main {
    padding: 64px 16px 36px;
  }

  .app-shell main#main > .lg\:hidden {
    gap: 4px;
    margin-bottom: 16px;
    padding-block: 8px;
    scrollbar-width: none;
  }

  .app-shell main#main > .lg\:hidden::-webkit-scrollbar {
    display: none;
  }

  .app-shell main#main > .lg\:hidden button {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  .app-shell .heading {
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 16px;
  }

  .app-shell .panel,
  .app-shell .product-card {
    padding: 16px;
  }

  .app-shell .kpi-grid,
  .app-shell .overview-stats {
    grid-template-columns: 1fr;
  }

  .app-shell .action-banner {
    align-items: stretch;
  }

  .app-shell .action-banner-actions {
    width: 100%;
  }

  .app-shell .action-banner-actions button {
    flex: 1;
  }

  .app-shell .fields {
    grid-template-columns: 1fr;
  }

  .app-shell .field.full {
    grid-column: auto;
  }
}

@media (max-width: 390px) {
  .app-shell > div > header {
    gap: 8px;
    padding-inline: 12px;
  }

  .app-shell > div > header > div {
    gap: 8px;
  }

  .app-shell main#main {
    padding-inline: 12px;
  }

  .app-shell .panel,
  .app-shell .product-card {
    padding: 14px;
  }
}

/* Final Stitch alignment for the global command bar and automation navigation. */
@media (min-width: 768px) {
  .app-shell .top-owner-profile {
    display: flex !important;
  }
}

@media (min-width: 1024px) {
  .automation-screen > .stitch-subnav {
    display: none;
  }
}

@media (max-width: 1023px) {
  .automation-screen > .stitch-subnav {
    display: flex;
    gap: 4px;
    overflow-x: auto;
    margin: 0 0 16px;
    padding: 4px;
    border: 1px solid #e5e5e5;
    background: #fff;
  }

  .automation-screen > .stitch-subnav button {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 0 10px;
  }

  .automation-screen > .stitch-subnav button small {
    color: #737373;
    font:
      500 10px/1 "JetBrains Mono",
      monospace;
  }
}

.connections-stitch .connection-card,
.connections-stitch .ai-connection-card {
  align-content: start;
  min-height: 220px;
}

.connections-stitch .connection-facts {
  display: grid;
  gap: 3px;
  margin: 0;
}

.connections-stitch .connection-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.connections-stitch .connection-facts dt {
  color: #737373;
}

.connections-stitch .connection-facts dd {
  margin: 0;
  font-weight: 600;
  text-align: right;
}

.connections-stitch .connection-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

/* Stitch completion: command shell, profile, UI-19, UI-23, UI-25. */
.brand-title,.brand-subtitle{display:block}.brand-title{font:600 16px/1.15 Geist,Arial,sans-serif}.brand-subtitle{margin-top:2px;color:#737373;font:500 10px/1.2 "JetBrains Mono",monospace}.sidebar-caption{padding:8px;color:#737373;font:600 10px/1 "JetBrains Mono",monospace;letter-spacing:.08em;text-transform:uppercase}.sidebar-automation{display:flex;align-items:center;justify-content:space-between;width:100%;padding:8px 12px;border:0;border-radius:8px;background:transparent;color:#525252;text-align:left}.sidebar-automation[aria-current="page"]{background:#f0f0f0;color:#171717;font-weight:600}.sidebar-automation>span{display:flex;align-items:center;gap:8px}.sidebar-automation .material-symbols-outlined{font-size:18px}.sidebar-automation small{padding:3px 5px;border-radius:4px;background:#f5f5f5;font:500 9px/1 "JetBrains Mono",monospace}.sidebar-agents{display:flex;flex-direction:column;margin:3px 0 3px 28px;padding-left:8px;border-left:1px solid #e5e5e5}.sidebar-footer{display:grid;gap:8px;padding:12px;border-top:1px solid #e5e5e5}.runtime-chip,.sidebar-owner{display:flex;align-items:center;justify-content:space-between}.runtime-chip{padding:7px 8px;border-radius:6px;background:#fafafa;font:500 10px/1 "JetBrains Mono",monospace}.runtime-chip span{display:flex;align-items:center;gap:6px}.runtime-chip i,.command-status i{width:7px;height:7px;border-radius:999px;background:#00a86b;box-shadow:0 0 0 3px rgba(0,168,107,.12)}.runtime-chip small{color:#a3a3a3}.sidebar-owner{gap:8px;width:100%;padding:7px 8px;border:0;background:transparent;text-align:left}.sidebar-owner>span:nth-child(2){display:grid;min-width:0;flex:1}.sidebar-owner strong,.sidebar-owner small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.sidebar-owner strong{font-size:12px}.sidebar-owner small{color:#8b8b8b;font-size:10px}.owner-avatar{display:grid!important;place-items:center;width:30px;height:30px;border-radius:999px;background:#171717;color:#fff;font-size:17px!important}.amir-command-bar{position:fixed;z-index:40;top:0;right:0;left:0;height:64px;display:flex;align-items:center;justify-content:space-between;padding:0 24px;border-bottom:1px solid #e5e5e5;background:rgba(255,255,255,.94);backdrop-filter:blur(14px)}@media(min-width:1024px){.amir-command-bar{left:256px}}.command-brand,.command-actions,.command-status,.top-owner-profile{display:flex;align-items:center}.command-brand{gap:10px}.command-brand svg{width:32px;height:32px}.command-actions{gap:12px}.command-status{gap:8px;padding:7px 12px;border:1px solid #ececec;border-radius:6px;background:#fafafa;font:500 10px/1 "JetBrains Mono",monospace}.icon-command{display:grid;place-items:center;width:34px;height:34px;border:0;border-radius:7px;background:transparent;color:#525252}.icon-command:hover,.icon-command.active{background:#f0f0f0;color:#0070f3}.profile-anchor{position:relative}.top-owner-profile{gap:8px;padding:4px 6px;border:0;border-radius:8px;background:transparent;text-align:left}.top-owner-profile:hover,.top-owner-profile[aria-expanded="true"]{background:#f5f5f5}.owner-copy{display:none}.owner-copy strong,.owner-copy small{display:block}.owner-copy strong{font-size:12px}.owner-copy small{color:#8b8b8b;font-size:10px}.profile-chevron{font-size:17px!important;color:#737373}.profile-popover{position:absolute;top:46px;right:0;width:232px;padding:6px;border:1px solid #e5e5e5;border-radius:10px;background:#fff;box-shadow:0 16px 40px rgba(0,0,0,.12)}.profile-popover-head{display:grid;padding:10px 11px;border-bottom:1px solid #eee}.profile-popover-head strong{font-size:13px}.profile-popover-head span{color:#737373;font-size:11px}.profile-popover button{display:flex;align-items:center;gap:9px;width:100%;padding:9px 10px;border:0;border-radius:6px;background:transparent;text-align:left}.profile-popover button:hover{background:#f5f5f5}.profile-popover .material-symbols-outlined{font-size:18px}.profile-popover .profile-logout{margin-top:4px;border-top:1px solid #eee;border-radius:0 0 6px 6px;color:#b42318}.mobile-bottom-nav{display:none}
.notification-summary-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}.notification-summary-grid article{display:grid;gap:4px;padding:15px;border:1px solid #e5e5e5;border-radius:8px;background:#fff}.notification-summary-grid span{color:#737373;font:600 10px/1 "JetBrains Mono",monospace}.notification-summary-grid strong{font-size:15px}.notification-summary-grid small{color:#737373}.notification-list{display:grid;gap:8px;margin-top:14px}.notification-item{display:grid;grid-template-columns:32px 1fr;gap:10px;padding:13px;border:1px solid #e8e8e8;border-radius:8px}.notification-item>span{color:#00a86b}.notification-item.is-critical>span{color:#b54708}.notification-item-head{display:flex;justify-content:space-between;gap:12px}.notification-item p{margin:4px 0;color:#525252}.notification-item small{color:#8b8b8b;font:500 10px/1.4 "JetBrains Mono",monospace}.runner-safety-banner{display:flex;gap:12px;margin-bottom:18px;padding:14px 16px;border:1px solid #b7e4d3;border-radius:8px;background:#f1fbf7}.runner-safety-banner>span{color:#008f5d}.runner-safety-banner p{margin:3px 0 0;color:#45645a}.runner-entry-card{display:flex;align-items:center;justify-content:space-between;gap:18px}.runner-entry-card h2{margin:8px 0 4px}.account-settings-grid{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(320px,.8fr);gap:16px}.account-credentials form{padding-top:18px;margin-top:18px;border-top:1px solid #ededed}.account-identity{display:flex;justify-content:space-between;align-items:center;padding:14px;border:1px solid #e5e5e5;border-radius:8px;background:#fafafa}.account-identity div{display:grid;gap:4px}.account-identity small{color:#737373;font:600 10px/1 "JetBrains Mono",monospace}.session-list{display:grid;gap:8px;margin-top:14px}.session-item{display:grid;grid-template-columns:34px 1fr auto;gap:10px;align-items:center;padding:12px;border:1px solid #e5e5e5;border-radius:8px}.session-item.is-current{border-color:#a7d4ff;background:#f4f9ff}.session-item>span:first-child{color:#737373}.session-item p,.session-item small{margin:2px 0;color:#737373;font-size:11px}.stitch-loading{display:flex;align-items:center;gap:12px;padding:24px}.stitch-loading h2,.stitch-loading p{margin:0}.stitch-loading>span{color:#0070f3}
@media(min-width:768px){.owner-copy{display:block}}
@media(max-width:767px){.amir-command-bar{height:58px;padding:0 12px}.command-actions{gap:6px}.top-owner-profile{padding:2px}.profile-chevron,.owner-copy{display:none}.profile-popover{position:fixed;top:56px;right:10px}.app-shell main#main{padding-top:74px!important;padding-bottom:90px!important}.mobile-bottom-nav{position:fixed;z-index:45;right:0;bottom:0;left:0;display:grid;grid-template-columns:repeat(5,1fr);height:64px;padding:5px 5px calc(5px + env(safe-area-inset-bottom));border-top:1px solid #e5e5e5;background:rgba(255,255,255,.97);backdrop-filter:blur(12px)}.mobile-bottom-nav button{display:grid;place-items:center;gap:1px;padding:2px;border:0;border-radius:7px;background:transparent;color:#737373}.mobile-bottom-nav button[aria-current="page"]{color:#0070f3;background:#f0f7ff}.mobile-bottom-nav .material-symbols-outlined{font-size:20px}.mobile-bottom-nav small{font-size:9px}.notification-summary-grid,.account-settings-grid{grid-template-columns:1fr}.runner-entry-card{align-items:stretch;flex-direction:column}.notification-item{grid-template-columns:26px 1fr}.notification-item-head{align-items:flex-start;flex-direction:column;gap:5px}.session-item{grid-template-columns:30px 1fr}.session-item>.badge{grid-column:2}.stitch-page-head{align-items:flex-start;flex-direction:column}.stitch-page-head>.actions-row{width:100%;flex-wrap:wrap}}
.lifecycle-dialog{width:min(560px,calc(100vw - 24px))}.lifecycle-dialog-kicker{display:flex;align-items:center;gap:7px;margin-bottom:10px;color:#525252;font:600 10px/1 "JetBrains Mono",monospace;text-transform:uppercase;letter-spacing:.06em}.lifecycle-dialog-kicker .material-symbols-outlined{font-size:17px}.lifecycle-dialog dl{display:grid;gap:0;margin:14px 0;border:1px solid #e5e5e5;border-radius:8px;overflow:hidden}.lifecycle-dialog dl>div{display:grid;grid-template-columns:90px 1fr;gap:12px;padding:10px 12px;background:#fafafa}.lifecycle-dialog dl>div+div{border-top:1px solid #e5e5e5}.lifecycle-dialog dt{color:#737373;font:600 10px/1.4 "JetBrains Mono",monospace;text-transform:uppercase}.lifecycle-dialog dd{margin:0;font-size:12px}.lifecycle-dialog-status{margin:14px 0 0;padding:12px;border:1px solid #d8d8d8;border-radius:8px;background:#fafafa}.lifecycle-dialog-status strong,.lifecycle-dialog-status p,.lifecycle-dialog-status code{display:block}.lifecycle-dialog-status p{margin:4px 0 0}.lifecycle-dialog-status code{margin-top:7px;padding:6px;border-radius:4px;background:rgba(0,0,0,.05);font-size:10px;word-break:break-all}.lifecycle-dialog-status.is-loading{border-color:#acd4ff;background:#f2f8ff}.lifecycle-dialog-status.is-success{border-color:#a9dec9;background:#f1fbf7;color:#006b47}.lifecycle-dialog-status.is-partial{border-color:#edc48c;background:#fff8ed;color:#8a4b08}.lifecycle-dialog-status.is-error{border-color:#f0b2ad;background:#fff5f4;color:#a52a21}.dialog-spinner{display:inline-block;width:12px;height:12px;border:2px solid currentColor;border-right-color:transparent;border-radius:999px;animation:dialog-spin .8s linear infinite}@keyframes dialog-spin{to{transform:rotate(360deg)}}
.notification-item.is-unread{border-left:3px solid #0070f3;background:#f8fbff}.notification-item.is-read{background:#fff}.notification-actions{margin-top:10px;flex-wrap:wrap}.recovery-job-list{display:grid;gap:12px;margin-top:14px}.recovery-job-card{padding:14px;border:1px solid #e5e5e5;border-radius:8px}.recovery-job-card small{overflow-wrap:anywhere;color:#737373}.recovery-job-card .actions-row{flex-wrap:wrap;margin-top:12px}#recovery-jobs-panel{margin-bottom:18px}
/* Per-product overrides must remain reachable in batch mode. */
.batch-editor .intake-rail{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.batch-editor .intake-rail .preflight-card{grid-column:1/-1}@media(max-width:767px){.batch-editor .intake-rail{grid-template-columns:1fr}}
@media(min-width:1024px){.amir-command-bar .command-brand{display:none}}@media(max-width:1023px){.amir-command-bar .command-status{display:none}}

.batch-list-title{min-width:0;max-width:100%;overflow-wrap:anywhere}
/* Automasi legacy + mobile cards (Stitch AMIR Mobile, qa/legacy-automation-stitch-20260927) */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.auto-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding:20px 20px 0}
.auto-stat{min-width:0;padding:14px;border:1px solid #e5e5e5;border-radius:4px;background:#fff}
.auto-stat small{display:block;font:600 10px/1.3 var(--mono);color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.auto-stat strong{display:block;margin:8px 0 2px;font:600 24px/1 var(--mono);font-variant-numeric:tabular-nums}
.auto-stat span{font-size:11px;color:var(--muted)}
.auto-note{display:flex;gap:10px;margin:14px 20px 0;padding:14px;border:1px solid #e5e5e5;border-radius:4px;background:#fafafa;font-size:13px}
.auto-note>.material-symbols-outlined{color:var(--blue)}.auto-note p{margin:4px 0 10px;color:var(--muted);font-size:12px;line-height:1.5}
.auto-section{margin:22px 20px 0}.auto-section:last-child{margin-bottom:20px}
.auto-section>header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:16px 0 10px}.auto-section>header:first-child{margin-top:0}
.auto-section h2{margin:0;font-size:15px}
.auto-toolbar{display:grid;gap:10px;margin-bottom:12px}
.auto-search{width:100%;min-height:44px;padding:8px 12px;border:1px solid #e5e5e5;border-radius:4px;background:#fff}
.auto-filter{display:flex;gap:8px;overflow-x:auto;padding-bottom:2px;scrollbar-width:thin}
.auto-filter button{flex:0 0 auto;min-height:44px;padding:0 14px;border:1px solid #e5e5e5;border-radius:999px;background:#fff;color:var(--ink);font:500 12px var(--mono)}
.auto-filter button b{margin-left:4px;font-weight:600;opacity:.7}
.auto-filter button[aria-pressed=true]{border-color:#171717;background:#171717;color:#fff}
.auto-card-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,340px),1fr));gap:12px}
.auto-card{display:flex;flex-direction:column;gap:10px;min-width:0;padding:14px;border:1px solid #e5e5e5;border-left:3px solid #c4c7c7;border-radius:4px;background:#fff}
.auto-card[hidden]{display:none}
.auto-card.tone-green{border-left-color:#07875d}.auto-card.tone-blue{border-left-color:#0070f3}
.auto-card.tone-amber{border-left-color:#d97706;background:#fffdf6}.auto-card.tone-red{border-left-color:#ba1a1a;background:#fffafa}.auto-card.tone-gray{background:#fafafa}
.auto-card h3{margin:0;font-size:14px;line-height:1.4;overflow-wrap:anywhere}
.auto-card-id{margin:0;font:11px/1.4 var(--mono);color:var(--muted);overflow-wrap:anywhere}
.auto-chips{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
.chip{display:inline-flex;align-items:center;max-width:100%;min-height:22px;padding:2px 8px;border:1px solid #e5e5e5;border-radius:4px;background:#fafafa;font:500 10px/1.3 var(--mono);overflow-wrap:anywhere}
.chip.owner-legacy{border-color:#d4d4d4;background:#f0f0f0;color:#404040}.chip.owner-shadow{border-color:#aec6ff;background:#eef3ff;color:#0057c0}.chip.owner-amir{border-color:#171717;background:#171717;color:#fff}
.auto-card .badge,.auto-section .badge,.auto-detail .badge{display:inline-flex;align-items:center;gap:5px;border-radius:999px}
.auto-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:0}.auto-grid-3{grid-template-columns:repeat(3,minmax(0,1fr))}
.auto-card-grid>div{min-width:0;padding:8px;border-radius:4px;background:#f5f5f5}
.auto-card-grid dt{font:600 9px/1.3 var(--mono);color:var(--muted);text-transform:uppercase;letter-spacing:.04em}
.auto-card-grid dd{margin:3px 0 0;font-size:12px;line-height:1.4;overflow-wrap:anywhere}
.auto-card footer{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-top:auto;padding-top:10px;border-top:1px solid #efeded;font:10px/1.4 var(--mono);color:var(--muted)}
.auto-card-actions{display:flex;flex-wrap:wrap;gap:8px}
.auto-card button,.auto-note button,.auto-owner button,.auto-detail .actions button{min-height:44px;padding:0 14px}
.auto-callout{margin:0;padding:10px 12px;border-radius:4px;font-size:12px;line-height:1.5;overflow-wrap:anywhere}
.auto-callout.red{background:#fdecea;color:#8c1d18}.auto-callout.amber{background:#fff4dc;color:#7a4b00}
.auto-empty{display:grid;justify-items:center;gap:6px;padding:28px 16px;border:1px dashed #d4d4d4;border-radius:4px;text-align:center}
.auto-empty .material-symbols-outlined{color:#07875d}.auto-empty p{margin:0;color:var(--muted);font-size:12px}
.auto-sheet-button{display:flex;align-items:center;justify-content:center;width:100%;min-height:48px;padding:0 14px;border-radius:6px;background:#171717;color:#fff!important;font-weight:600;text-align:center;text-decoration:none}
.auto-sheet-button:focus-visible{outline:2px solid #0070f3;outline-offset:2px}
.auto-sheet-button[aria-disabled=true]{background:#eeeeee;color:#6b6b6b!important;cursor:not-allowed}
.auto-accordion{border:1px solid #e5e5e5;border-radius:4px;background:#fff}
.auto-accordion>summary{display:flex;align-items:center;min-height:44px;padding:0 14px;cursor:pointer;font-weight:600;font-size:13px}
.auto-accordion[open]>summary{border-bottom:1px solid #efeded}
.auto-accordion>.auto-card-list,.auto-accordion>.auto-tech,.auto-accordion>.table-overflow{margin:12px}
.legacy-gakomon>.auto-card,.legacy-hamen>.auto-card{margin-bottom:12px}
.legacy-gakomon>.auto-accordion{margin-top:12px}
.auto-detail-overlay .auto-detail{width:min(680px,100%);max-height:92vh;overflow:auto;display:grid;gap:16px}
.auto-detail-head{position:relative;display:grid;gap:8px;padding-right:48px}
.auto-detail-head h2{margin:0;font-size:18px;line-height:1.35;overflow-wrap:anywhere}
.auto-detail-close{position:absolute;top:0;right:0;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid #e5e5e5;border-radius:6px;background:#fff}
.auto-detail section h3{margin:0 0 8px;font-size:14px}
.auto-owner{padding:14px;border:1px solid #e5e5e5;border-radius:4px;background:#fafafa}.auto-owner p{margin:0 0 10px;color:var(--muted);font-size:12px;line-height:1.5}
.auto-tool-list{display:grid;gap:8px;margin:0;padding:0;list-style:none}
.auto-tool-list li{display:grid;grid-template-columns:1fr auto;gap:4px 10px;padding:10px;border:1px solid #efeded;border-radius:4px}
.auto-tool-list p{grid-column:1/-1;margin:0;color:var(--muted);font-size:12px}
.auto-tech{display:grid;gap:0;margin:12px}
.auto-tech>div{display:grid;grid-template-columns:minmax(110px,40%) 1fr;gap:10px;padding:8px 0;border-bottom:1px solid #f0f0f0}
.auto-tech dt{color:var(--muted);font-size:12px}.auto-tech dd{margin:0;font:12px/1.4 var(--mono);overflow-wrap:anywhere}
.auto-timeline{display:grid;gap:10px;margin:0;padding:0 0 0 16px;border-left:2px solid #e5e5e5;list-style:none}
.auto-timeline li{display:grid;gap:2px;font-size:12px}.auto-timeline time,.auto-timeline span{font:10px var(--mono);color:var(--muted)}
.auto-checks{display:grid;gap:6px;margin:12px 0;padding:0;list-style:none}
.auto-checks li{display:flex;gap:8px;align-items:flex-start;font-size:12px;line-height:1.4}.auto-checks .material-symbols-outlined{font-size:18px}
.auto-checks li.ok .material-symbols-outlined{color:#07875d}.auto-checks li.fail .material-symbols-outlined{color:#ba1a1a}
.auto-ack{display:flex;gap:8px;align-items:flex-start;margin:6px 0;font-size:12px;line-height:1.4}.auto-ack input{width:20px;height:20px;flex:0 0 auto}
@media(max-width:900px){.auto-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:767px){
  .automation-screen .automation-toolbar button,#automation-panel button,#automation-panel summary{min-height:44px}
  .auto-stats{padding:14px 14px 0;gap:8px}.auto-note{margin:14px 14px 0}.auto-section{margin:18px 14px 0}
  .auto-stat{padding:12px}.auto-stat strong{font-size:22px}
  .automation-toolbar.stitch-subnav{flex-direction:row;flex-wrap:nowrap;align-items:stretch;gap:6px;overflow-x:auto;padding:4px;scrollbar-width:none}
  .automation-toolbar.stitch-subnav button{flex:0 0 auto;width:auto;white-space:nowrap}
  .automation-guardrails{grid-template-columns:1fr;margin:18px 14px}
  .automation-agent-grid{padding:14px 14px 0}.automation-diagnostic{margin:14px 14px 0}
  .auto-detail-overlay .auto-detail{max-height:94vh}
}
@media(max-width:360px){.auto-card-grid,.auto-grid-3{grid-template-columns:1fr}.auto-tech>div{grid-template-columns:1fr;gap:2px}}
.auto-detail-overlay .app-dialog.auto-detail{padding:18px 18px 0;gap:14px}
.auto-detail-overlay .auto-detail h2{padding:0;border:0;margin:0}
.auto-detail-overlay .auto-detail>.actions{margin:0 -18px;padding:12px 18px}
.auto-detail-overlay .auto-detail>.automation-loading{min-height:180px;display:grid;place-items:center}
@media(max-width:600px){.auto-detail-overlay .app-dialog.auto-detail{padding:16px 14px 0}.auto-detail-overlay .auto-detail>.actions{margin:0 -14px;padding:12px 14px}}
.auto-detail-overlay .auto-detail-close{min-width:44px}
