:root {
  /* Google Material Design 3 Light Theme Palette */
  --md-sys-color-primary: #0b57d0; /* Google Brand Blue */
  --md-sys-color-primary-hover: #0842a0;
  --md-sys-color-primary-active: #062e6f;
  --md-sys-color-on-primary: #ffffff;
  --md-sys-color-primary-container: #d3e3fd; /* Soft Blue Container */
  --md-sys-color-on-primary-container: #041e49;

  --md-sys-color-secondary: #00639b;
  --md-sys-color-on-secondary: #ffffff;
  --md-sys-color-secondary-container: #cbe6ff;
  --md-sys-color-on-secondary-container: #001e35;

  --md-sys-color-surface: #f8f9fa; /* Google Page Background */
  --md-sys-color-surface-container: #ffffff; /* Card backgrounds */
  --md-sys-color-surface-container-low: #f0f4f9; /* Subtle sidebar/panel backgrounds */
  --md-sys-color-surface-container-high: #e9eef6; /* Highlight panels */
  --md-sys-color-on-surface: #1f1f1f; /* Primary text */
  --md-sys-color-on-surface-variant: #444746; /* Muted/secondary text */

  --md-sys-color-outline: #74777f;
  --md-sys-color-outline-variant: #c4c7c5; /* Thin light dividers */

  --md-sys-color-error: #b3261e; /* Google Alert Red */
  --md-sys-color-error-container: #f9dedc;
  --md-sys-color-on-error: #ffffff;
  --md-sys-color-on-error-container: #410e0b;

  --md-sys-color-success: #146c36; /* Google Success Green */
  --md-sys-color-success-container: #cbf2d6;
  --md-sys-color-on-success: #ffffff;
  --md-sys-color-on-success-container: #00210a;

  --md-sys-color-warning: #b06000; /* Google Warning Orange/Amber */
  --md-sys-color-warning-container: #ffe0db;
  --md-sys-color-on-warning: #ffffff;
  --md-sys-color-on-warning-container: #3d1b00;

  /* Material Spacing & Elevation Tokens */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-pill: 100px;

  /* Elevation Shadows (Material 3 Specs) */
  --elevation-1: 0 1px 2px 0 rgba(60,64,67,0.3), 0 1px 3px 1px rgba(60,64,67,0.15);
  --elevation-2: 0 1px 2px 0 rgba(60,64,67,0.3), 0 2px 6px 2px rgba(60,64,67,0.15);
  --elevation-3: 0 4px 12px 3px rgba(60,64,67,0.15), 0 1px 3px 0 rgba(60,64,67,0.3);

  /* Animation Curves */
  --md-transition-standard: 250ms cubic-bezier(0.2, 0, 0, 1);
  --md-transition-decelerate: 200ms cubic-bezier(0, 0, 0.2, 1);
  --md-transition-accelerate: 150ms cubic-bezier(0.3, 0, 1, 1);

  /* Legacy Variable Compatibility Mappings */
  --bg: var(--md-sys-color-surface);
  --surface: var(--md-sys-color-surface-container);
  --surface-muted: var(--md-sys-color-surface-container-low);
  --surface-strong: var(--md-sys-color-surface-container-high);
  --border: var(--md-sys-color-outline-variant);
  --border-strong: var(--md-sys-color-outline);
  --text: var(--md-sys-color-on-surface);
  --muted: var(--md-sys-color-on-surface-variant);
  --primary: var(--md-sys-color-primary);
  --primary-dark: var(--md-sys-color-primary-hover);
  --primary-soft: var(--md-sys-color-primary-container);
  --coral: var(--md-sys-color-error);
  --coral-soft: var(--md-sys-color-error-container);
  --mint: var(--md-sys-color-success);
  --mint-soft: var(--md-sys-color-success-container);
  --sun: var(--md-sys-color-warning);
  --sun-soft: var(--md-sys-color-warning-container);
  --success-bg: var(--md-sys-color-success-container);
  --success-text: var(--md-sys-color-success);
  --success-border: #a3e8b4;
  --danger-bg: var(--md-sys-color-error-container);
  --danger-text: var(--md-sys-color-error);
  --danger-border: #f5c2c0;
  --shadow-sm: var(--elevation-1);
  --shadow: var(--elevation-2);
  --shadow-md: var(--elevation-3);
  --radius: var(--radius-md);
  --radius-lg: var(--radius-lg);
  --radius-sm: var(--radius-sm);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body {
  line-height: 1.6;
}

a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--md-transition-standard);
}

a:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}

button,
input,
textarea,
select {
  font: inherit;
}

.page-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Topbar / Navigation Header ───────────────────────── */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: border-color var(--md-transition-standard);
}

.topbar-inner,
.auth-shell,
.portal-shell {
  width: 100%;
  max-width: 1140px;
  padding: 0 24px;
  margin: 0 auto;
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: #fff;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 2px 4px rgba(11, 87, 208, 0.2);
}

.brand-copy {
  display: grid;
  gap: 0px;
}

.brand-copy strong {
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.1rem;
  line-height: 1.1;
  color: var(--text);
  letter-spacing: -0.01em;
}

.brand-copy span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-user {
  display: grid;
  gap: 1px;
  text-align: right;
}

.topbar-user strong {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
}

.topbar-user span {
  color: var(--muted);
  font-size: 0.75rem;
}

.user-pill-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
}

.user-pill {
  display: grid;
  gap: 1px;
  text-align: right;
}

.user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}

.user-mobile {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.2;
}

/* ─── Authentication Page & Layout ──────────────────────── */

.auth-shell {
  display: grid;
  gap: 32px;
  align-content: center;
  min-height: calc(100vh - 64px);
  padding: 40px 0 64px;
}

.auth-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(400px, 0.8fr);
  gap: 48px;
  align-items: center;
}

.auth-intro {
  max-width: 640px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 8px;
}

.auth-intro h1 {
  margin: 12px 0 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.auth-intro p {
  margin: 16px 0 0;
  font-size: 1.05rem;
  line-height: 1.65;
  color: var(--muted);
}

.feature-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 32px;
}

.feature-chip {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 20px;
  transition: transform var(--md-transition-standard), box-shadow var(--md-transition-standard);
}

.feature-chip:hover {
  transform: translateY(-2px);
  box-shadow: var(--elevation-2);
}

.feature-chip strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

.feature-chip span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.auth-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-container);
  box-shadow: var(--elevation-2);
  padding: 36px;
  transition: box-shadow var(--md-transition-standard);
}

.card-title {
  margin-bottom: 24px;
}

.card-title h2 {
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.card-title p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.form-grid {
  display: grid;
  gap: 18px;
}

.inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.auth-fields {
  grid-template-columns: 1.6fr 1fr;
}

.auth-mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin: -8px 0 22px;
  padding: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
}

.auth-mode-option {
  min-height: 40px;
  border: 0;
  border-radius: calc(var(--radius-sm) - 2px);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.auth-mode-option.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--elevation-1);
}

.signup-phone-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.9fr) minmax(0, 1.4fr);
  gap: 12px;
}

.verification-card {
  width: min(100% - 32px, 520px);
  margin: 0 auto;
}

.auth-card {
  overflow: visible;
}

.phone-entry {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: stretch;
}

.country-code-picker {
  position: relative;
  z-index: 20;
}

.country-code-trigger {
  display: flex;
  width: 100%;
  height: 48px;
  align-items: center;
  gap: 5px;
  padding: 0 7px;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: #fff;
  color: var(--text);
  cursor: text;
}

.country-code-trigger:focus-within {
  position: relative;
  z-index: 1;
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(11, 87, 208, 0.15);
}

.country-code-input {
  width: 43px;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 650;
}

.country-code-toggle {
  display: grid;
  width: 20px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  place-items: center;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.country-code-trigger img,
.country-code-option img {
  flex: 0 0 auto;
  border: 1px solid rgba(0, 0, 0, 0.12);
  object-fit: cover;
}

.phone-national-input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.country-code-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 1000;
  width: 132px;
  max-height: 280px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(31, 45, 38, 0.22);
}

.country-code-menu[hidden] {
  display: none;
}

.country-code-option {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text);
  font: inherit;
  cursor: pointer;
}

.country-code-option:hover,
.country-code-option:focus,
.country-code-option[aria-selected="true"] {
  outline: none;
  background: var(--surface-muted);
  color: var(--primary);
}

.btn-verify-account {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid #d49a2f;
  border-radius: 8px;
  background: #fff8e8;
  color: #7a4b00;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 750;
  cursor: pointer;
}

.btn-verify-account:hover,
.btn-verify-account:focus {
  outline: none;
  background: #ffefc7;
  box-shadow: 0 0 0 3px rgba(212, 154, 47, 0.16);
}

.auth-inline-link {
  border: 0;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.auth-inline-link:hover,
.auth-inline-link:focus {
  color: var(--primary-dark);
  outline: none;
}

.verification-modal-open {
  overflow: hidden;
}

.verification-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 3000;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(12, 24, 20, 0.56);
  backdrop-filter: blur(3px);
}

.verification-modal {
  position: relative;
  width: min(100%, 480px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 32px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(15, 30, 24, 0.3);
}

.verification-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 1.45rem;
  line-height: 1;
  cursor: pointer;
}

.verification-modal-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.verification-modal-success {
  text-align: center;
}

.verification-modal-success p {
  margin: 10px 0 24px;
  color: var(--muted);
}

.verification-success-mark {
  display: grid;
  width: 54px;
  height: 54px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 50%;
  background: #e3f4ec;
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 800;
}

/* ─── Google Outlined Inputs & Forms ───────────────────── */

.label {
  display: inline-block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.field,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--md-sys-color-outline-variant);
  border-radius: var(--radius-sm);
  background: #ffffff;
  padding: 0 16px;
  color: var(--text);
  font-size: 0.95rem;
  transition: border-color var(--md-transition-standard), box-shadow var(--md-transition-standard);
}

.field,
.select {
  height: 48px;
}

.textarea {
  min-height: 120px;
  padding: 12px 16px;
  resize: vertical;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23444746'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  padding-right: 40px;
}

.field:hover:not(:disabled),
.textarea:hover:not(:disabled),
.select:hover:not(:disabled) {
  border-color: var(--md-sys-color-outline);
}

.field:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(11, 87, 208, 0.15);
}

.field::placeholder,
.textarea::placeholder {
  color: var(--md-sys-color-outline);
  opacity: 0.6;
}

.field:disabled,
.select:disabled {
  background: var(--surface-muted);
  color: var(--muted);
  border-color: var(--border);
  cursor: not-allowed;
}

.field[type="file"] {
  padding: 6px 12px;
  display: flex;
  align-items: center;
}

.field::file-selector-button {
  min-height: 32px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--md-sys-color-outline-variant);
  background-color: var(--md-sys-color-surface-container-low);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: background-color var(--md-transition-standard), border-color var(--md-transition-standard);
}

.field::file-selector-button:hover {
  background-color: #f4f8fe;
  border-color: #a8c7fa;
}

/* ─── Buttons & Action Controls (Google Pill) ─────────── */

.btn-primary,
.btn-secondary,
.btn-linkish,
.profile-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 24px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color var(--md-transition-standard), border-color var(--md-transition-standard), box-shadow var(--md-transition-standard), transform 100ms var(--md-transition-accelerate);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: var(--md-sys-color-on-primary);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--elevation-1);
}

.btn-primary:active {
  background: var(--primary-active);
  transform: scale(0.97);
}

.btn-secondary {
  background: var(--surface-container);
  border-color: var(--md-sys-color-outline-variant);
  color: var(--primary);
}

.btn-secondary:hover {
  background: #f4f8fe;
  border-color: #a8c7fa;
}

.btn-secondary:active {
  background: #e8f0fe;
  transform: scale(0.97);
}

.btn-compact {
  min-height: 34px;
  padding: 0 16px;
  font-size: 0.82rem;
}

.profile-pill {
  min-height: 36px;
  padding: 0 16px;
  border-color: var(--md-sys-color-outline-variant);
  background: var(--surface-container);
  color: var(--muted);
}

.profile-pill:hover,
.profile-pill.active {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft);
}

.btn-linkish {
  min-height: 32px;
  padding: 0 12px;
  color: var(--primary);
  background: transparent;
  font-size: 0.85rem;
}

.btn-linkish:hover {
  background: var(--primary-soft);
  text-decoration: none;
}

.helper {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 10px;
}

/* ─── Alerts & Validation Boxes ───────────────────────── */

.error-box,
.success-box {
  margin-bottom: 16px;
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.88rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 10px;
}

.error-box {
  border: 1px solid var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger-text);
}

.success-box {
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  color: var(--success-text);
}

/* ─── Shell & Layout Geometry ────────────────────────── */

.portal-shell {
  display: grid;
  padding: 24px 0 48px;
}

.guided-shell {
  gap: 0;
}

.content-surface {
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  background: var(--surface-container);
  box-shadow: var(--elevation-1);
  padding: 0;
  overflow: hidden;
}

.guided-surface {
  border: none;
  background: transparent;
  box-shadow: none;
}

/* ─── Workbench Shell (CA / Admin full-width pages) ─────── */

.workbench-shell {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding: 32px 24px 56px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.workbench-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-container);
  box-shadow: var(--elevation-1);
  padding: 32px;
  overflow: hidden;
}

.workbench-card + .workbench-card {
  margin-top: 0;
}

/* ─── Cards & Layout Sections ────────────────────────── */

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.section-head h2 {
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
}

.section-head p {
  margin: 4px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-container);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.kpi-card span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.kpi-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1.6rem;
  line-height: 1.1;
  font-weight: 700;
  color: var(--text);
}

.info-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-container);
  box-shadow: var(--shadow-sm);
  padding: 20px;
}

.info-card h3 {
  margin: 0 0 12px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.grid-two {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 20px;
  margin-top: 16px;
}

/* ─── Taxpayer Filings Panel (Dashboard List) ────────── */

.taxpayer-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-container);
  box-shadow: var(--elevation-1);
  overflow: hidden;
}

.taxpayer-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

.taxpayer-panel-header h2 {
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.taxpayer-panel-header p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.taxpayer-list {
  display: grid;
  gap: 0;
}

.taxpayer-item {
  display: block;
  width: 100%;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  padding: 0;
}

.taxpayer-item:last-child {
  border-bottom: none;
}

.taxpayer-button {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  padding: 16px 24px;
  background: transparent;
  border: none;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background-color var(--md-transition-standard), box-shadow var(--md-transition-standard);
}

.taxpayer-button:hover {
  background: var(--surface-muted);
}

.taxpayer-button.active {
  background: linear-gradient(90deg, #eff6ff 0%, #ffffff 40%);
  box-shadow: inset 4px 0 0 var(--primary);
}

.taxpayer-main {
  display: grid;
  gap: 3px;
  flex: 1;
  min-width: 0;
}

.taxpayer-name-line {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.taxpayer-main strong {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.taxpayer-subline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.taxpayer-subline span {
  position: relative;
  font-size: 0.8rem;
  color: var(--muted);
}

.taxpayer-subline span + span::before {
  content: "•";
  margin-right: 8px;
  color: var(--md-sys-color-outline-variant);
}

.taxpayer-side {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-end;
  flex-shrink: 0;
}

.taxpayer-badges {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.taxpayer-fy {
  background: var(--surface-muted);
  color: var(--muted);
  border: 1px solid var(--border);
}

.taxpayer-button.active .taxpayer-main strong {
  color: var(--primary-dark);
}

/* ─── Wizard Cards & Intake Geometry ──────────────────── */

.wizard-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-container);
  box-shadow: var(--elevation-1);
  padding: 32px;
  margin-bottom: 24px;
}

.guided-surface .wizard-card {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.secondary-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-container);
  box-shadow: var(--shadow-sm);
  margin-top: 16px;
  padding: 20px;
}

.wizard-copy {
  margin-bottom: 24px;
}

.wizard-copy h2 {
  margin: 6px 0 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}

.wizard-copy p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.section-kicker {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

.inline-note {
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
}

.workbench-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.action-toolbar {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

/* ─── Detail Panels & Segmented Google Tabs ───────────── */

.filing-detail-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface-container);
  box-shadow: var(--elevation-2);
  overflow: hidden;
}

.filing-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #f8fafd 0%, #ffffff 100%);
}

.filing-detail-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.filing-detail-avatar {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%);
  color: #fff;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.4rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  text-transform: uppercase;
  box-shadow: 0 2px 6px rgba(11, 87, 208, 0.25);
}

.filing-detail-name {
  margin: 0;
  font-family: "Space Grotesk", "Inter", sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}

.filing-detail-sub {
  margin-top: 4px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Google Search/Mail Underlined Segmented Tabs */
.filing-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  background: var(--surface-container);
}

.filing-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: none;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: color var(--md-transition-standard), border-color var(--md-transition-standard);
  margin-bottom: -1px;
}

.filing-tab:hover {
  color: var(--text);
}

.filing-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
}

.filing-tab.active .tab-count {
  background: var(--primary-soft);
  color: var(--primary);
}

.filing-tab-body {
  padding: 24px;
}

.filing-tab-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px;
}

.filing-detail-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
}

.filing-detail-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px 24px;
}

.filing-detail-field {
  display: grid;
  gap: 4px;
}

.filing-detail-field-wide {
  grid-column: 1 / -1;
}

.head-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.head-chip {
  min-height: 26px;
  font-weight: 600;
}

.checkbox-fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 8px;
}

.checkbox-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.3;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.checkbox-option:hover {
  border-color: var(--border-strong);
  background: var(--surface-muted);
}

.checkbox-option input {
  flex: none;
  width: 16px;
  height: 16px;
  accent-color: var(--p-forest, #0b5d4b);
  cursor: pointer;
}

.checkbox-option:focus-within {
  border-color: var(--p-forest, #0b5d4b);
  box-shadow: 0 0 0 3px var(--p-forest-soft, #e1efe9);
}

.checkbox-fieldset[data-invalid="true"] .checkbox-option {
  border-color: var(--p-danger, #a63e32);
}

.filing-detail-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.filing-detail-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
}

.filing-detail-actions {
  padding: 16px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  background: var(--surface-muted);
  border-top: 1px solid var(--border);
}

/* ─── Lists & Tables ──────────────────────────────────── */

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 0.9rem;
}

.table th {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--surface-muted);
}

.table tr:last-child td {
  border-bottom: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border-radius: var(--radius-pill);
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #a8c7fa;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-badge.pending {
  background: var(--sun-soft);
  color: var(--sun);
  border: 1px solid #ffd0b8;
}

.status-badge.submitted {
  background: var(--mint-soft);
  color: var(--mint);
  border: 1px solid #bbf2c8;
}

.status-badge.default {
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #bfdbfe;
}

/* ─── Files and Documents ────────────────────────────── */

.filing-doc-list {
  display: grid;
  gap: 10px;
}

.filing-doc-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface-container);
  transition: border-color var(--md-transition-standard), box-shadow var(--md-transition-standard);
}

.filing-doc-row:hover {
  border-color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.filing-doc-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  opacity: 0.7;
  color: var(--primary);
}

.filing-doc-info {
  flex: 1;
  min-width: 0;
  display: grid;
  gap: 3px;
}

.filing-doc-info strong {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filing-doc-info span {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ─── Messaging Conversation UI (WhatsApp Chat Style) ─── */

.message-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 480px;
  overflow-y: auto;
  padding: 16px;
  border-radius: var(--radius-md);
  background-color: #efeae2; /* WhatsApp Chat Background */
  border: 1px solid var(--border);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.06);
}

.chat {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 12px;
  row-gap: 2px;
  padding: 2px 0;
  width: 100%;
}

.chat-start {
  place-items: start;
  grid-template-columns: auto 1fr;
}

.chat-end {
  place-items: end;
  grid-template-columns: 1fr auto;
}

.chat-header {
  grid-row-start: 1;
  font-size: 0.72rem;
  color: var(--md-sys-color-on-surface-variant);
  opacity: 0.75;
  margin-bottom: 2px;
}

.chat-start .chat-header {
  grid-column-start: 2;
}

.chat-end .chat-header {
  grid-column-start: 1;
}

.chat-bubble {
  grid-row-start: 2;
  position: relative;
  display: block;
  width: fit-content;
  max-width: 85%;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.4;
  box-shadow: 0 1px 1px rgba(0,0,0,0.12);
}

/* WhatsApp Left Bubble */
.chat-start .chat-bubble {
  grid-column-start: 2;
  background-color: #ffffff;
  color: #1f1f1f;
  border-top-left-radius: 0; /* Fold effect */
}

/* WhatsApp Right Bubble (Green accent) */
.chat-end .chat-bubble {
  grid-column-start: 1;
  background-color: #d9fdd3; /* WhatsApp Green */
  color: #1f1f1f;
  border-top-right-radius: 0; /* Fold effect */
}

.chat-footer {
  grid-row-start: 3;
  font-size: 0.65rem;
  color: var(--muted);
  opacity: 0.8;
  margin-top: 2px;
}

.chat-start .chat-footer {
  grid-column-start: 2;
}

.chat-end .chat-footer {
  grid-column-start: 1;
}

.chat-input-area {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background-color: #f0f2f5; /* Light grey bottom bar like WhatsApp */
  border-top: 1px solid var(--border);
}

.chat-input-field {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e3e3e3;
  border-radius: 24px;
  padding: 10px 18px;
  font-size: 0.92rem;
  line-height: 1.4;
  height: 40px;
  color: var(--text);
  box-shadow: 0 1px 1px rgba(0,0,0,0.04);
  transition: border-color var(--md-transition-standard), box-shadow var(--md-transition-standard);
}

.chat-input-field:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.chat-send-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background-color: #00a884; /* WhatsApp Teal-green send button color */
  color: #ffffff;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0,0,0,0.12);
  transition: background-color var(--md-transition-standard), transform 100ms;
  flex-shrink: 0;
}

.chat-send-btn:hover {
  background-color: #008f72;
  transform: scale(1.05);
}

.chat-send-btn:active {
  transform: scale(0.95);
}

/* Empty States */
.empty-state {
  border: 2px dashed var(--md-sys-color-outline-variant);
  border-radius: var(--radius-md);
  background: var(--surface-muted);
  padding: 32px;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

code {
  font-family: "SFMono-Regular", Consolas, Menlo, monospace;
  font-size: 0.85em;
  background: var(--surface-strong);
  padding: 2px 6px;
  border-radius: 4px;
}

#workspace-content #topbar-user {
  display: none;
}

/* ─── HTMX Progress Loading indicator ──────────────────── */

.htmx-request {
  opacity: 0.65;
  pointer-events: none;
  cursor: wait;
  transition: opacity 250ms ease;
}

/* Spinner shown only while its request is in flight. hx-disabled-elt sets
   `disabled` on the button for the duration, so drive the spinner off that.
   Do NOT hang this off .htmx-request on the button itself — that class carries
   pointer-events: none, which cancels the in-flight submit before it sends. */
.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: btn-spin 700ms linear infinite;
}

button:disabled .btn-spinner {
  display: inline-block;
}

@keyframes btn-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn-spinner {
    animation: none;
  }
}

/* ─── Responsive & Touch Layout ──────────────────────── */

@media (max-width: 900px) {
  .auth-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  
  .auth-fields {
    grid-template-columns: 1fr;
  }

  .feature-strip,
  .kpi-grid,
  .grid-two,
  .inline-grid,
  .signup-phone-grid,
  .filing-detail-grid,
  .filing-tab-two-col {
    grid-template-columns: 1fr;
  }
  
  .topbar-inner {
    flex-direction: row;
    padding: 0 16px;
  }

  .workbench-head,
  .section-head,
  .filing-detail-header,
  .taxpayer-panel-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .action-toolbar {
    justify-content: flex-start;
  }

  .topbar-user {
    text-align: right;
  }

  .taxpayer-button {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px;
  }

  .taxpayer-side {
    justify-content: flex-start;
  }

  .taxpayer-badges {
    justify-content: flex-start;
  }

  .auth-card,
  .content-surface,
  .wizard-card,
  .secondary-panel {
    padding: 20px;
  }
}

@media (max-width: 520px) {
  .phone-entry {
    grid-template-columns: 104px minmax(0, 1fr);
  }

  .verification-modal {
    padding: 26px 20px 22px;
  }

  .verification-modal-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .verification-modal-actions > * {
    width: 100%;
  }
}

/* Interactive Status Selector Dropdown Badges */
.handoff-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.handoff-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.handoff-badge.sun {
  background-color: var(--sun-soft);
  color: var(--sun);
  border: 1px solid #ffd0b8;
}

.handoff-badge.sky {
  background-color: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #bfdbfe;
}

.status-handoff-btn {
  width: 100%;
  margin-top: 14px;
}

.status-select option {
  background-color: #ffffff;
  color: var(--text);
  font-weight: 500;
  font-size: 0.85rem;
}

/* --------------------------------------------------------------------------
   ITR123 professional workspace refresh
   A compact, high-trust visual system shared by public, taxpayer, CA and admin.
   -------------------------------------------------------------------------- */

:root {
  --brand-950: #0b1f33;
  --brand-900: #102a43;
  --brand-800: #173f5f;
  --brand-700: #1d4f73;
  --brand-600: #1769aa;
  --brand-500: #2478bd;
  --brand-100: #dbeafe;
  --brand-50: #eff6ff;
  --canvas: #f3f6f8;
  --canvas-strong: #e8eef3;
  --surface-container: #ffffff;
  --primary-active: #123f78;
  --ink: #132238;
  --ink-soft: #526377;
  --line: #d8e0e7;
  --line-strong: #bdc9d3;
  --teal: #0f766e;
  --teal-soft: #dff5f1;
  --amber: #a85d00;
  --amber-soft: #fff3d6;
  --red: #b42318;
  --red-soft: #feeceb;
  --green: #18794e;
  --green-soft: #e3f5ea;
  --bg: var(--canvas);
  --surface: var(--surface-container);
  --surface-muted: #f6f8fa;
  --surface-strong: var(--canvas-strong);
  --border: var(--line);
  --border-strong: var(--line-strong);
  --text: var(--ink);
  --muted: var(--ink-soft);
  --primary: #155eef;
  --primary-dark: #1049bd;
  --primary-soft: var(--brand-50);
  --radius-sm: 6px;
  --radius-md: 9px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow-sm: 0 1px 2px rgba(16, 42, 67, 0.05);
  --shadow: 0 8px 24px rgba(16, 42, 67, 0.08);
  --shadow-md: 0 18px 48px rgba(16, 42, 67, 0.14);
}

html,
body {
  background: var(--canvas);
}

body {
  line-height: 1.5;
  font-size: 14px;
}

.page-shell {
  background:
    radial-gradient(circle at 85% -10%, rgba(21, 94, 239, 0.055), transparent 28rem),
    var(--canvas);
}

.topbar {
  background: rgba(255, 255, 255, 0.96);
  border-bottom-color: rgba(189, 201, 211, 0.75);
  box-shadow: 0 1px 0 rgba(16, 42, 67, 0.02);
}

.topbar-inner,
.auth-shell,
.portal-shell {
  max-width: 1360px;
}

.topbar-inner {
  height: 68px;
  padding-inline: 28px;
}

.brand {
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--brand-900);
  box-shadow: none;
  font-size: 0.76rem;
  letter-spacing: -0.03em;
}

.brand-mark::after {
  content: "";
  width: 8px;
  height: 8px;
  position: absolute;
  transform: translate(12px, -12px);
  border-radius: 50%;
  background: #3b82f6;
  border: 2px solid #fff;
}

.brand-copy strong {
  color: var(--brand-950);
  font-size: 1.06rem;
  letter-spacing: -0.025em;
}

.brand-copy span {
  margin-top: 2px;
  color: #6b7c8f;
  font-size: 0.62rem;
  letter-spacing: 0.11em;
}

.topbar-actions {
  gap: 10px;
}

.topbar-user strong {
  color: var(--brand-950);
}

.topbar-user span {
  color: #728195;
}

.topbar-nav {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 2px;
  margin-left: auto;
  margin-right: 18px;
}

.topbar-nav a,
.topbar-nav button {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 13px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: #526377;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.topbar-nav a:hover,
.topbar-nav button:hover,
.topbar-nav .active {
  background: var(--brand-50);
  color: var(--primary-dark);
  text-decoration: none;
}

.profile-pill,
.btn-primary,
.btn-secondary,
.btn-linkish {
  border-radius: 7px;
}

.btn-primary,
.btn-secondary,
.profile-pill {
  min-height: 38px;
  padding: 0 16px;
}

.btn-primary {
  background: var(--primary);
  box-shadow: 0 1px 2px rgba(21, 94, 239, 0.2);
}

.btn-secondary,
.profile-pill {
  background: #fff;
  border-color: var(--line-strong);
  color: var(--brand-800);
}

.btn-danger-soft {
  color: var(--red) !important;
  background: var(--red-soft) !important;
  border-color: #f7c5c1 !important;
}

/* Public and role login surfaces */
.auth-shell {
  min-height: calc(100vh - 68px);
  padding: 64px 28px 56px;
}

.auth-layout {
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 430px);
  gap: clamp(48px, 8vw, 112px);
}

.auth-intro {
  max-width: 720px;
}

.auth-intro h1 {
  max-width: 690px;
  margin-top: 16px;
  color: var(--brand-950);
  font-family: "Inter", sans-serif;
  font-size: clamp(2.55rem, 4.5vw, 4.25rem);
  line-height: 1.03;
  letter-spacing: -0.055em;
}

.auth-intro p {
  max-width: 650px;
  margin-top: 20px;
  color: #526377;
  font-size: 1.02rem;
  line-height: 1.65;
}

.eyebrow {
  min-height: 26px;
  padding: 0 10px;
  border-radius: 6px;
  background: var(--teal-soft);
  color: var(--teal);
  letter-spacing: 0.09em;
}

.feature-strip {
  gap: 10px;
  margin-top: 30px;
}

.feature-chip {
  position: relative;
  min-height: 132px;
  padding: 18px;
  border-color: var(--line);
  border-radius: 10px;
  box-shadow: none;
}

.feature-chip::before {
  content: "";
  display: block;
  width: 30px;
  height: 3px;
  margin-bottom: 16px;
  border-radius: 4px;
  background: var(--primary);
}

.feature-chip:hover {
  transform: none;
  border-color: #a9bfd1;
  box-shadow: var(--shadow-sm);
}

.feature-chip strong {
  color: var(--brand-950);
}

.feature-chip span {
  color: #617286;
  line-height: 1.5;
}

.auth-card {
  position: relative;
  padding: 34px;
  border: 1px solid #cbd6df;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 22px 55px rgba(16, 42, 67, 0.13);
}

.auth-card::before {
  content: "Secure access";
  position: absolute;
  top: -13px;
  right: 22px;
  min-height: 26px;
  display: inline-flex;
  align-items: center;
  padding: 0 10px;
  border: 1px solid #b8e1d9;
  border-radius: 20px;
  background: #effaf7;
  color: var(--teal);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card-title h2 {
  color: var(--brand-950);
  font-family: "Inter", sans-serif;
  font-size: 1.45rem;
  letter-spacing: -0.025em;
}

.auth-trust-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 28px;
  color: #607085;
  font-size: 0.78rem;
  font-weight: 600;
}

.auth-trust-row span::before {
  content: "\2713";
  margin-right: 6px;
  color: var(--teal);
  font-weight: 800;
}

.field,
.textarea,
.select {
  border-color: #bfcbd5;
  border-radius: 7px;
  background-color: #fff;
}

.field,
.select {
  height: 44px;
}

.label {
  color: #42556a;
  font-size: 0.69rem;
  letter-spacing: 0.07em;
}

/* Shared workspace geometry */
.portal-shell,
.workbench-shell {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px;
}

.portal-shell {
  display: block;
}

.workbench-shell {
  gap: 18px;
}

.content-surface,
.guided-surface {
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.workspace-page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.workspace-page-head h1 {
  margin: 4px 0 0;
  color: var(--brand-950);
  font-family: "Inter", sans-serif;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.workspace-page-head p {
  margin: 7px 0 0;
  color: #607085;
  font-size: 0.9rem;
}

.section-kicker {
  color: var(--teal);
  font-size: 0.67rem;
  letter-spacing: 0.1em;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.metric-grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.metric-card {
  position: relative;
  min-height: 104px;
  padding: 17px 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.metric-card::after {
  content: "";
  position: absolute;
  right: -18px;
  bottom: -30px;
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: var(--brand-50);
}

.metric-card.attention::after {
  background: var(--amber-soft);
}

.metric-card.success::after {
  background: var(--green-soft);
}

.metric-label {
  position: relative;
  z-index: 1;
  color: #68798c;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.metric-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 8px;
  color: var(--brand-950);
  font-size: 1.65rem;
  font-weight: 750;
  line-height: 1;
  letter-spacing: -0.04em;
}

.metric-note {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 7px;
  color: #7a899a;
  font-size: 0.74rem;
}

.ops-panel,
.workbench-card,
.taxpayer-panel,
.wizard-card,
.filing-detail-card {
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.workbench-card {
  padding: 24px;
}

.ops-panel {
  overflow: hidden;
}

.ops-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--line);
}

.ops-panel-head h2 {
  margin: 0;
  color: var(--brand-950);
  font-family: "Inter", sans-serif;
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.ops-panel-head p {
  margin: 3px 0 0;
  color: #6c7c8e;
  font-size: 0.78rem;
}

.filter-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-field {
  width: 230px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: #fff;
  color: var(--ink);
  font-size: 0.82rem;
}

.filter-select {
  width: 175px;
}

.table-wrap {
  border: 0;
  border-radius: 0;
}

.table th,
.table td {
  padding: 11px 16px;
  border-bottom-color: #e3e8ed;
  font-size: 0.84rem;
}

.table th {
  height: 40px;
  color: #536578;
  font-size: 0.66rem;
  letter-spacing: 0.075em;
  background: #f7f9fb;
}

.table tbody tr {
  transition: background 120ms ease;
}

.table tbody tr:hover {
  background: #f8fbff;
}

.status-badge,
.pill,
.status-select {
  min-height: 23px;
  border-radius: 6px;
  font-size: 0.69rem;
}

.status-badge.pending,
.status-select.pending {
  background: var(--amber-soft);
  border-color: #f1d69a;
  color: var(--amber);
}

.status-badge.submitted,
.status-select.completed {
  background: var(--green-soft);
  border-color: #b9dfc8;
  color: var(--green);
}

.status-badge.default,
.pill {
  background: var(--brand-50);
  border-color: #c5daf8;
  color: #2458a6;
}

.status-badge.blocked,
.status-select.hold {
  background: var(--red-soft);
  border-color: #f4c6c2;
  color: var(--red);
}

.empty-state {
  border: 0;
  border-radius: 0;
  background: #f8fafb;
  padding: 38px 24px;
}

.empty-state-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  border-radius: 10px;
  background: var(--brand-100);
  color: var(--primary-dark);
  font-weight: 800;
}

/* Taxpayer home */
.taxpayer-dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(280px, 0.75fr);
  gap: 16px;
}

.taxpayer-panel {
  box-shadow: var(--shadow-sm);
}

.taxpayer-panel-header {
  padding: 17px 20px;
  background: #fff;
}

.taxpayer-button {
  min-height: 74px;
  padding: 13px 20px;
}

.taxpayer-button.active {
  background: linear-gradient(90deg, #edf5ff 0%, #fff 56%);
  box-shadow: inset 3px 0 0 var(--primary);
}

.action-panel {
  overflow: hidden;
  border: 1px solid #bdd4f7;
  border-radius: 11px;
  background: #fff;
}

.action-panel-head {
  padding: 17px 18px;
  background: var(--brand-900);
  color: #fff;
}

.action-panel-head span {
  display: block;
  color: #b9d3e8;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.action-panel-head strong {
  display: block;
  margin-top: 5px;
  font-size: 1rem;
}

.action-panel-body {
  padding: 17px 18px;
}

.action-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.action-list li {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid #e6ebef;
  color: #45586c;
  font-size: 0.8rem;
}

.action-list li:last-child {
  border-bottom: 0;
}

.action-list b {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-50);
  color: var(--primary);
  font-size: 0.68rem;
}

.filing-progress {
  display: flex;
  align-items: flex-start;
  margin-top: 14px;
}

.progress-step {
  position: relative;
  flex: 1;
  padding-top: 23px;
  color: #748497;
  font-size: 0.67rem;
  font-weight: 650;
  text-align: center;
}

.progress-step::before {
  content: "";
  position: absolute;
  top: 4px;
  left: calc(50% - 7px);
  z-index: 2;
  width: 14px;
  height: 14px;
  border: 3px solid #d6e0e7;
  border-radius: 50%;
  background: #fff;
}

.progress-step::after {
  content: "";
  position: absolute;
  top: 10px;
  left: -50%;
  width: 100%;
  height: 2px;
  background: #dfe6eb;
}

.progress-step:first-child::after {
  display: none;
}

.progress-step.done,
.progress-step.active {
  color: var(--brand-900);
}

.progress-step.done::before,
.progress-step.active::before {
  border-color: var(--primary);
  background: var(--primary);
}

.progress-step.done::after,
.progress-step.active::after {
  background: var(--primary);
}

/* Filing workspace */
.filing-detail-card {
  box-shadow: none;
}

.ops-panel > #workspace-content > .filing-detail-card {
  border: 0;
  border-radius: 0;
}

.filing-detail-header {
  padding: 18px 20px;
  background: #fff;
}

.filing-detail-avatar {
  width: 42px;
  height: 42px;
  border-radius: 9px;
  background: var(--brand-900);
  box-shadow: none;
  font-size: 1.1rem;
}

.filing-detail-name {
  font-family: "Inter", sans-serif;
  font-size: 1.15rem;
}

.filing-tabs {
  min-height: 46px;
  padding-inline: 12px;
  background: #f8fafb;
}

.filing-tab {
  min-height: 46px;
  padding-inline: 14px;
}

.filing-tab-body {
  padding: 20px;
}

.filing-detail-grid {
  gap: 18px 24px;
}

.filing-detail-section-title {
  color: #536578;
}

.filing-context-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 2px;
}

.filing-overview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
}

.filing-detail-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.filing-progress-wide {
  max-width: 720px;
  margin: 8px auto 4px;
}

.filing-next-action {
  align-self: stretch;
  padding: 20px;
  border: 1px solid #c6d8ee;
  border-radius: 9px;
  background: linear-gradient(155deg, #f8fbff 0%, #fff 72%);
}

.filing-next-action h3 {
  margin: 22px 0 7px;
  color: var(--brand-950);
  font-size: 1rem;
  letter-spacing: -0.015em;
}

.filing-next-action p {
  margin: 0;
  color: #5f7083;
  font-size: 0.8rem;
  line-height: 1.55;
}

.filing-next-links {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.filing-next-links button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--primary-dark);
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}

.filing-next-links button:hover {
  color: var(--primary);
}

.breadcrumb {
  color: #68798c;
  font-size: 0.78rem;
}

.breadcrumb a {
  color: var(--primary-dark);
}

/* Admin shell */
.admin-shell {
  width: 100%;
  max-width: 1440px;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 20px;
  margin: 0 auto;
  padding: 24px 28px 48px;
}

.admin-sidebar {
  position: sticky;
  top: 92px;
  height: fit-content;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

.admin-sidebar-title {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  color: #718094;
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  padding: 8px;
}

.admin-nav a {
  padding: 10px 11px;
  border-radius: 7px;
  color: #4e6074;
  font-size: 0.82rem;
  font-weight: 600;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: var(--brand-50);
  color: var(--primary-dark);
  text-decoration: none;
}

.admin-main {
  min-width: 0;
}

.admin-main .workbench-card {
  margin-bottom: 16px;
  padding: 0;
}

.admin-main .workbench-head {
  align-items: center;
  margin: 0;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.admin-main .wizard-copy h2 {
  font-family: "Inter", sans-serif;
  font-size: 1.05rem;
}

.admin-main .wizard-copy p {
  margin-top: 4px;
  line-height: 1.45;
}

.admin-main #add-ca-panel:not(:empty) {
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid #bcd1f0;
  border-radius: 11px;
  background: #f8fbff;
  box-shadow: var(--shadow-sm);
}

/* Forms and settings pages */
.wizard-card {
  max-width: 920px;
  padding: 26px;
}

.guided-surface .wizard-card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.secondary-panel {
  box-shadow: none;
}

@media (max-width: 1050px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .taxpayer-dashboard-grid {
    grid-template-columns: 1fr;
  }

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

  .filing-overview-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: static;
  }

  .admin-nav {
    display: flex;
    overflow-x: auto;
  }
}

@media (max-width: 900px) {
  .auth-shell {
    padding: 36px 20px;
  }

  .auth-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 36px;
  }

  .auth-intro h1 {
    font-size: clamp(2.2rem, 10vw, 3.2rem);
  }

  .topbar-nav {
    display: none;
  }

  .portal-shell,
  .workbench-shell,
  .admin-shell {
    padding: 20px 16px 36px;
  }

  .workspace-page-head,
  .ops-panel-head,
  .filing-context-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .filter-field,
  .filter-select {
    width: 100%;
  }
}

@media (max-width: 620px) {
  .topbar-user {
    display: none;
  }

  .topbar-inner {
    padding-inline: 16px;
  }

  .topbar-actions {
    gap: 6px;
  }

  .profile-pill,
  .topbar-actions .btn-secondary {
    min-height: 34px;
    padding-inline: 10px;
    font-size: 0.76rem;
  }

  .feature-strip,
  .metric-grid {
    grid-template-columns: 1fr;
  }

  .feature-chip {
    min-height: auto;
  }

  .auth-card {
    padding: 26px 22px;
  }

  .taxpayer-side {
    justify-content: flex-start;
  }

  .filing-progress {
    display: grid;
    gap: 8px;
  }

  .progress-step {
    padding: 0 0 0 26px;
    text-align: left;
  }

  .progress-step::before {
    top: 1px;
    left: 0;
  }

  .progress-step::after {
    display: none;
  }
}

/* Inline validation preserves form state and points to only the fields needing attention. */
.inline-field-error {
  margin: 6px 0 0;
  color: #b42318;
  font-size: 0.8rem;
  font-weight: 600;
  line-height: 1.35;
}

.field[aria-invalid="true"],
.select[aria-invalid="true"],
.chat-input-field[aria-invalid="true"] {
  border-color: #d92d20;
  box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.1);
}

.document-delivery > .helper {
  margin: -4px 0 16px;
}

.document-method-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.document-method-option {
  display: flex;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface, #fff);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.document-method-option:hover {
  border-color: var(--primary);
}

.document-method-option[aria-pressed="true"] {
  border-color: var(--primary);
  background: rgba(30, 95, 116, 0.06);
  box-shadow: 0 0 0 3px rgba(30, 95, 116, 0.1);
}

.document-method-option strong,
.document-method-option small {
  display: block;
}

.document-method-option small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.35;
}

.document-method-icon {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: rgba(30, 95, 116, 0.1);
  color: var(--primary);
  font-size: 1.2rem;
  font-weight: 700;
}

.direct-ca-panel {
  max-width: 680px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface, #fff);
}

.direct-ca-panel h3 {
  margin: 6px 0 18px;
}

.direct-ca-details {
  display: grid;
  gap: 10px;
  margin-bottom: 20px;
}

.direct-ca-details div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.direct-ca-details span {
  color: var(--muted);
  font-size: 0.84rem;
}

.direct-ca-details strong {
  overflow-wrap: anywhere;
}

.direct-ca-disclosure {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .document-method-options {
    grid-template-columns: 1fr;
  }

  .direct-ca-details div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}
