:root {
  color-scheme: light;
  --ink: #1f2732;
  --muted: #687382;
  --line: #d8e0e7;
  --surface: #ffffff;
  --page: #f4f7f8;
  --navy: #203547;
  --green: #138462;
  --green-soft: #e6f5ef;
  --amber: #b86b00;
  --amber-soft: #fff4dd;
  --rose: #b7374b;
  --rose-soft: #fff0f3;
  --blue-soft: #eef5ff;
  --shadow: 0 14px 34px rgba(32, 53, 71, 0.09);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  background: var(--page);
  color: var(--ink);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

.topbar {
  align-items: center;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 68px;
  padding: 12px clamp(18px, 4vw, 42px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand,
.topbar nav,
.topbar nav form {
  align-items: center;
  display: flex;
  gap: 10px;
}

.brand {
  min-width: 220px;
}

.brand small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  margin-top: 2px;
}

.mark {
  align-items: center;
  background: var(--navy);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  letter-spacing: 0;
  width: 42px;
}

.mark.large {
  height: 58px;
  width: 58px;
}

.topbar nav {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar nav a,
.link-button,
.actions button,
.actions a {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--navy);
  cursor: pointer;
  font-weight: 800;
  min-height: 36px;
  padding: 8px 10px;
}

.topbar nav a:hover,
.link-button:hover,
.actions button:hover,
.actions a:hover {
  border-color: #9fb5c7;
}

.link-button {
  white-space: nowrap;
}

.shell {
  margin: 0 auto;
  max-width: 1380px;
  padding: 24px clamp(16px, 4vw, 42px) 48px;
}

.hero {
  align-items: center;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 18px;
}

.hero.compact {
  background: linear-gradient(90deg, #ffffff, #f8fbff);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.hero h1 {
  font-size: clamp(1.6rem, 2.5vw, 2.5rem);
  line-height: 1.05;
  margin: 4px 0 0;
}

.eyebrow {
  color: var(--rose);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

.grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

.grid.two {
  align-items: start;
  grid-template-columns: minmax(0, 1.05fr) minmax(330px, 0.95fr);
}

.stack {
  display: grid;
  gap: 18px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.primary-panel {
  min-height: 540px;
}

.panel-head,
.status-row,
.actions {
  align-items: center;
  display: flex;
  gap: 10px;
}

.panel-head {
  justify-content: space-between;
  margin-bottom: 14px;
}

.panel h2 {
  font-size: 1rem;
  margin: 0 0 12px;
}

.panel-head h2 {
  margin: 0;
}

.status-row,
.actions {
  flex-wrap: wrap;
}

.muted {
  color: var(--muted);
}

.messages {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.message {
  background: var(--green-soft);
  border: 1px solid #b9dfd0;
  border-radius: 8px;
  color: var(--green);
  padding: 11px 12px;
}

.message.error,
.message.warning {
  background: var(--rose-soft);
  border-color: #efbec8;
  color: var(--rose);
}

.badge {
  background: var(--blue-soft);
  border: 1px solid #c9d9ef;
  border-radius: 999px;
  color: var(--navy);
  display: inline-flex;
  font-size: 0.78rem;
  font-weight: 850;
  line-height: 1;
  padding: 7px 9px;
}

.badge.good {
  background: var(--green-soft);
  border-color: #b9dfd0;
  color: var(--green);
}

.badge.warn {
  background: var(--amber-soft);
  border-color: #efcd92;
  color: var(--amber);
}

.form-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-grid .full {
  grid-column: 1 / -1;
}

label {
  color: var(--navy);
  display: grid;
  font-size: 0.84rem;
  font-weight: 850;
  gap: 6px;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #c8d2dc;
  border-radius: 7px;
  color: var(--ink);
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  line-height: 1.45;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #6e94b2;
  box-shadow: 0 0 0 3px rgba(110, 148, 178, 0.18);
  outline: none;
}

.checkline {
  align-items: center;
  display: flex;
  flex-direction: row;
  gap: 8px;
}

.checkline input {
  min-height: auto;
  width: auto;
}

.button {
  align-items: center;
  background: var(--green);
  border: 1px solid transparent;
  border-radius: 7px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 42px;
  padding: 9px 14px;
}

.button:hover {
  background: #0f7254;
}

.button.secondary {
  background: var(--navy);
}

.button.secondary:hover {
  background: #172838;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  border-collapse: collapse;
  min-width: 760px;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 11px 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.error-cell {
  color: var(--rose);
  max-width: 320px;
}

.help-list,
.steps {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 21px;
}

.panel p {
  line-height: 1.55;
}

.link-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.link-grid a {
  background: #f8fafb;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--navy);
  font-weight: 850;
  padding: 11px 12px;
}

.handoff-block {
  background: #17212b;
  border-radius: 8px;
  color: #f5f8fb;
  line-height: 1.45;
  margin: 0;
  overflow-x: auto;
  padding: 16px;
  white-space: pre-wrap;
}

.login-body {
  align-items: center;
  background:
    linear-gradient(120deg, rgba(32, 53, 71, 0.94), rgba(19, 132, 98, 0.78)),
    #203547;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding: 24px;
}

.login-shell {
  width: min(100%, 430px);
}

.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 32px;
}

.login-panel h1 {
  margin: 16px 0 4px;
}

.stack-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

@media (max-width: 980px) {
  .grid.two {
    grid-template-columns: 1fr;
  }

  .hero,
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar nav {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .form-grid {
    grid-template-columns: 1fr;
  }

  .topbar nav,
  .topbar nav a,
  .topbar nav form,
  .link-button {
    width: 100%;
  }
}

/* AIBiz topbar contrast guard: keeps header actions readable through theme/color updates. */
:root {
  --aibiz-topbar-button-bg: var(--surface, var(--panel, #ffffff));
  --aibiz-topbar-button-text: var(--deep, var(--ink, #17202a));
  --aibiz-topbar-button-hover-bg: color-mix(in srgb, var(--accent, var(--primary, #0e7c7b)) 12%, var(--surface, #ffffff));
  --aibiz-topbar-button-hover-text: var(--accent-strong, var(--primary-dark, var(--primary, #0a5f66)));
  --aibiz-topbar-button-border: var(--line, #d9e2e7);
}

.topbar .ghost-button {
  background: var(--aibiz-topbar-button-bg);
  border-color: var(--aibiz-topbar-button-border);
  color: var(--aibiz-topbar-button-text);
  text-decoration: none;
  text-shadow: none;
  transition: border-color 120ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.topbar .ghost-button:hover,
.topbar .ghost-button:focus-visible {
  background: var(--aibiz-topbar-button-hover-bg);
  border-color: var(--accent, var(--primary, #0e7c7b));
  color: var(--aibiz-topbar-button-hover-text);
  text-decoration: none;
}

.topbar .ghost-button:visited {
  color: var(--aibiz-topbar-button-text);
}

.topbar .ghost-button:hover:visited {
  color: var(--aibiz-topbar-button-hover-text);
}

