/* ==========================================================================
   I2File Support Portal — Modern UI/UX Stylesheet (portal.css)
   Compatible with osTicket v1.15.8.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;750&display=swap');

:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --radius: 8px;
  --radius-sm: 6px;
  --radius-lg: 12px;

  /* Color Palette */
  --background: #f8fafc;
  --foreground: #0f172a;
  --card: #ffffff;
  --card-foreground: #0f172a;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-foreground: #ffffff;
  --secondary: #f1f5f9;
  --secondary-foreground: #334155;
  --muted: #f8fafc;
  --muted-foreground: #64748b;
  --accent: #f1f5f9;
  --accent-foreground: #2563eb;
  --border: #e2e8f0;
  --input: #cbd5e1;
  --ring: rgba(37, 99, 235, 0.2);

  /* Status & Accents */
  --teal: #0d9488;
  --teal-soft: #f0fdfa;
  --teal-border: #ccfbf1;
  --blue-soft: #eff6ff;
  --blue-border: #dbeafe;
  --destructive: #ef4444;
  --destructive-soft: #fef2f2;
  --warning: #f59e0b;
  --warning-soft: #fffbeb;

  /* Shadows */
  --soft-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --modal-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

/* ==========================================================================
   Aggressive Reset for Legacy osTicket theme.css Rules
   ========================================================================== */
html, body {
  margin: 0 !important;
  padding: 0 !important;
  background: var(--background) !important;
  background-image: none !important;
  color: var(--foreground) !important;
  font-family: var(--font-sans) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden !important;
  width: 100% !important;
}

/* Kill link hover dotted underlines from legacy theme.css while strictly protecting buttons, cards, tabs, and pagination */
a:not(.portal-button):not(.split-link):not(.stat-tile):not(.profile-chip):not(.resource-link):not(.ticket-page-nav-btn):not(.ticket-page-pill):not(.ticket-tab-item):not(.ticket-list-refresh-btn):not(.ticket-mobile-card):not([class*="btn"]):not([class*="button"]):not([class*="card"]):not([class*="tab"]):not([class*="pill"]):hover,
.link:hover {
  text-decoration: none !important;
  border-bottom: none !important;
  cursor: pointer;
}

/* Ensure text links don't have default browser underlines */
a:not(.portal-button):not(.split-link):not(.stat-tile):not(.profile-chip):not(.resource-link):not(.ticket-page-nav-btn):not(.ticket-page-pill):not(.ticket-tab-item):not(.ticket-list-refresh-btn):not(.ticket-mobile-card):not([class*="btn"]):not([class*="button"]):not([class*="card"]):not([class*="tab"]):not([class*="pill"]),
.link {
  text-decoration: none !important;
  cursor: pointer;
}

a,
a:hover,
.link,
.link:hover {
  margin-bottom: 0;
}

/* Reset legacy fixed-width #container */
#container,
div#container {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  -webkit-box-shadow: none !important;
  -moz-box-shadow: none !important;
  border: none !important;
}

/* Shell & Container */
.portal-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.portal-container {
  width: calc(100% - 64px) !important;
  max-width: 1140px !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  min-height: 40px;
  padding: 8px 18px;
  box-sizing: border-box;
  background: var(--primary) !important;
  color: var(--primary-foreground) !important;
  border: 1px solid var(--primary) !important;
  border-bottom: 1px solid var(--primary) !important;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  cursor: pointer;
  text-decoration: none !important;
  box-shadow: var(--soft-shadow) !important;
  transition: all 0.16s ease;
  white-space: nowrap;
}

.portal-button:hover {
  background: var(--primary-hover) !important;
  border: 1px solid var(--primary-hover) !important;
  border-bottom: 1px solid var(--primary-hover) !important;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(37, 99, 235, 0.15) !important;
}

.portal-button-outline {
  background: var(--card) !important;
  border: 1px solid var(--input) !important;
  border-bottom: 1px solid var(--input) !important;
  color: var(--foreground) !important;
  box-shadow: var(--soft-shadow) !important;
}

.portal-button-outline:hover {
  background: var(--secondary) !important;
  border: 1px solid var(--input) !important;
  border-bottom: 1px solid var(--input) !important;
  color: var(--primary) !important;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */
#content,
main#content,
.main-content {
  margin: 0 auto !important;
  padding-block: 40px 60px !important;
  min-height: auto !important;
  border: none !important;
  background: transparent !important;
  width: 100% !important;
}

/* Notice & Alert Banners */
.success-notice,
.error-notice,
.warning-notice {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin-bottom: 24px;
  font-size: 13px;
  font-weight: 500;
}

.success-notice {
  background: var(--teal-soft) !important;
  color: var(--teal) !important;
  border: 1px solid var(--teal-border) !important;
}

.error-notice {
  background: var(--destructive-soft) !important;
  color: var(--destructive) !important;
  border: 1px solid #fecaca !important;
}

.warning-notice {
  background: var(--warning-soft) !important;
  color: var(--warning) !important;
  border: 1px solid #fde68a !important;
}

/* ==========================================================================
   Page Heading (Sub-pages)
   ========================================================================== */
.page-heading {
  margin-bottom: 32px;
}

.page-heading .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

.page-heading h1 {
  font-size: 32px;
  font-weight: 750;
  line-height: 1.3;
  color: var(--foreground) !important;
  margin: 10px 0 8px 0;
  letter-spacing: -0.4px;
}

.page-heading p {
  font-size: 14px;
  color: var(--muted-foreground) !important;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Ticket Form Layout & Components
   ========================================================================== */
.form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  align-items: start;
}

.ticket-form {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  overflow: visible !important;
}

.ticket-form .form-section:first-of-type {
  border-top-left-radius: var(--radius);
  border-top-right-radius: var(--radius);
}

.ticket-form .form-actions {
  border-bottom-left-radius: var(--radius);
  border-bottom-right-radius: var(--radius);
}

.form-section {
  padding: 28px 32px;
  border-bottom: 1px solid var(--border);
  clear: both !important;
  overflow: visible !important;
  box-sizing: border-box !important;
}

.form-section:last-of-type {
  border-bottom: none;
}

.form-section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.section-number {
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--secondary);
  color: var(--muted-foreground);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.form-section-heading h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground) !important;
  margin: 0;
  flex: 1;
  letter-spacing: -0.2px;
}

.required-note {
  font-size: 11px;
  color: var(--muted-foreground);
  margin-left: auto;
}

/* Verified Profile Card (Logged-in state) */
.verified-profile {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
}

.verified-profile .avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--blue-soft);
  color: var(--primary);
  border: 1px solid var(--blue-border);
  font-weight: 700;
  font-size: 13px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.verified-profile strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: var(--foreground);
}

.verified-profile span {
  display: block;
  font-size: 12px;
  color: var(--muted-foreground);
}

.verified-label {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 6px !important;
  color: var(--teal) !important;
  font-size: 12px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  margin-left: auto !important;
}

.verified-label svg {
  color: var(--teal) !important;
  display: block !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
  position: relative !important;
  top: -0.5px !important;
}

/* Form Tables (Contact form & Dynamic Ticket form) */
.form-table {
  width: 100% !important;
  border-collapse: collapse !important;
  border: none !important;
  margin: 0 !important;
}

.form-table hr {
  display: none !important;
}

.form-table tr {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  border: none !important;
}

.form-table td {
  display: block !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding: 0 0 18px 0 !important;
  border: none !important;
}

.form-table tr:last-child td {
  padding-bottom: 0 !important;
}

/* Guest Contact Table 2-column grid */
.contact-table tbody {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 20px !important;
  width: 100% !important;
}

.contact-table .ui-form-header-row,
.contact-table tr:has(.form-header),
.contact-table .form-header {
  display: none !important;
}

.form-table .form-header {
  margin: 4px 0 16px 0 !important;
  padding-bottom: 8px !important;
  border-bottom: 1px solid var(--border) !important;
}

.form-table .form-header h3 {
  font-size: 14px !important;
  font-weight: 700 !important;
  color: var(--foreground) !important;
  margin: 0 0 4px 0 !important;
}

.form-table .form-header div,
.form-table .form-header p {
  font-size: 13px !important;
  color: var(--muted-foreground) !important;
  margin: 0 !important;
  line-height: 1.5 !important;
}

.field-block {
  display: block !important;
  clear: both !important;
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.form-table label span.error,
span.error,
font.error,
div.error {
  color: var(--destructive) !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  display: inline-block !important;
  margin-top: 4px !important;
}
/* Ensure rich text areas and elements hidden by Redactor stay hidden */
.redactor-box textarea:not(.redactor-source-open),
textarea.richtext[style*="display: none"],
textarea.richtext[style*="display:none"],
textarea[style*="display: none"],
textarea[style*="display:none"],
.form-table textarea[style*="display: none"],
.form-table textarea[style*="display:none"] {
  display: none !important;
}

/* Redactor Rich Text Editor Styles */
.redactor-box {
  border: 1px solid var(--input) !important;
  border-radius: var(--radius-sm) !important;
  overflow: visible !important;
  position: relative !important;
  background: var(--card) !important;
  margin-top: 6px !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
}

.redactor-box:focus-within,
.redactor-box.redactor-focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--ring) !important;
}

/* Redactor Floating Air Toolbar (used in Additional Information / Memo fields) */
.redactor-toolbar-wrapper-air {
  position: absolute !important;
  z-index: 1050 !important;
  overflow: visible !important;
}

.redactor-air {
  position: relative !important;
  z-index: 1051 !important;
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--modal-shadow) !important;
  padding: 4px 6px !important;
  display: none;
  align-items: center !important;
  gap: 2px !important;
}

/* Strictly hide when closed or no selection */
.redactor-air:not(.open),
.redactor-air[style*="display: none"],
.redactor-air[style*="display:none"] {
  display: none !important;
}

/* Only display when text is selected */
.redactor-air.open {
  display: flex !important;
}

.redactor-air a {
  color: var(--muted-foreground) !important;
  border-radius: var(--radius-sm) !important;
  transition: all 0.15s ease !important;
}

.redactor-air a:hover {
  background: var(--accent) !important;
  color: var(--primary) !important;
}

.redactor-toolbar {
  background: var(--background) !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 4px 8px !important;
  box-sizing: border-box !important;
}

.redactor-toolbar a {
  color: var(--muted-foreground) !important;
  border-radius: var(--radius-sm) !important;
  transition: all 0.15s ease !important;
}

.redactor-toolbar a:hover {
  background: var(--accent) !important;
  color: var(--primary) !important;
}

.redactor-in {
  padding: 14px 16px !important;
  font-family: var(--font-sans) !important;
  font-size: 13px !important;
  line-height: 1.6 !important;
  color: var(--foreground) !important;
  min-height: 140px !important;
}

.redactor-statusbar {
  background: var(--background) !important;
  border-top: 1px solid var(--border) !important;
  color: var(--muted-foreground) !important;
  font-size: 11px !important;
  padding: 6px 12px !important;
}

/* Filedrop Zone (Attachments) */
.filedrop {
  margin-top: 14px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.filedrop .dropzone {
  border: 1.5px dashed var(--input) !important;
  border-radius: var(--radius-sm) !important;
  background: var(--background) !important;
  padding: 22px 18px !important;
  text-align: center !important;
  color: var(--muted-foreground) !important;
  font-size: 13px !important;
  cursor: pointer !important;
  transition: all 0.15s ease !important;
}

.filedrop .dropzone:hover {
  border-color: var(--primary) !important;
  background: var(--blue-soft) !important;
}

.filedrop .dropzone i.icon-upload {
  font-size: 20px !important;
  margin-right: 6px !important;
  color: var(--primary) !important;
  vertical-align: middle !important;
}

.filedrop .dropzone a.manual {
  color: var(--primary) !important;
  font-weight: 600 !important;
  text-decoration: underline !important;
}

.filedrop .files,
.-redactor-container .filedrop .files,
.-redactor-container + .filedrop .files {
  border: none !important;
  padding: 0 !important;
  margin: 0 0 8px 0 !important;
}

.filedrop .files .file,
.-redactor-container .filedrop .files .file,
.-redactor-container + .filedrop .files .file {
  background: var(--card) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  margin-bottom: 6px !important;
  font-size: 12px !important;
  padding: 8px 14px !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  box-shadow: var(--soft-shadow) !important;
  min-height: 42px !important;
  box-sizing: border-box !important;
}

/* Non-image attachments (no src on img.preview): HIDE COMPLETELY - no empty box */
.filedrop .files .file img.preview:not([src]),
.filedrop .files .file img.preview[src=""],
.filedrop .preview:not([src]),
.filedrop .preview[src=""],
.-redactor-container .filedrop .files .file img.preview:not([src]),
.-redactor-container .filedrop .files .file img.preview[src=""],
.-redactor-container .filedrop .preview:not([src]),
.-redactor-container .filedrop .preview[src=""],
.-redactor-container + .filedrop .preview:not([src]),
.-redactor-container + .filedrop .preview[src=""] {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
  border: none !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Image thumbnail preview - uniform container filled completely by the image */
.filedrop .preview[src],
.filedrop .files .file .preview[src],
.filedrop .files .file img.preview[src],
.-redactor-container .filedrop .preview[src],
.-redactor-container .filedrop .files .file .preview[src],
.-redactor-container .filedrop .files .file img.preview[src],
.-redactor-container + .filedrop .preview[src],
.-redactor-container + .filedrop .files .file img.preview[src] {
  order: 1 !important;
  display: inline-block !important;
  width: 28px !important;
  height: 28px !important;
  min-width: 28px !important;
  max-width: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  object-fit: cover !important;
  border-radius: var(--radius-sm) !important;
  border: 1px solid var(--border) !important;
  background: var(--secondary) !important;
  padding: 0 !important;
  margin: 0 !important;
  box-sizing: border-box !important;
  float: none !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
  vertical-align: middle !important;
  overflow: hidden !important;
}

.filedrop .files .file .filetype,
.-redactor-container .filedrop .files .file .filetype,
.-redactor-container + .filedrop .files .file .filetype {
  order: 2 !important;
  flex-shrink: 0 !important;
  margin: 0 !important;
}

.filedrop .files .file .filename,
.-redactor-container .filedrop .files .file .filename,
.-redactor-container + .filedrop .files .file .filename {
  order: 3 !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  word-break: break-word !important;
}

.filedrop .files .file .filesize,
.-redactor-container .filedrop .files .file .filesize,
.-redactor-container + .filedrop .files .file .filesize {
  color: var(--muted-foreground) !important;
  font-size: 11px !important;
  margin-left: 4px !important;
  white-space: nowrap !important;
}

/* Delete / Trash button placed at the end of the row */
.filedrop .files .file .trash,
.filedrop .files .file .pull-right.trash,
.-redactor-container .filedrop .files .file .trash,
.-redactor-container .filedrop .files .file .pull-right.trash,
.-redactor-container + .filedrop .files .file .trash,
.-redactor-container + .filedrop .files .file .pull-right.trash {
  order: 10 !important;
  margin-left: auto !important;
  cursor: pointer !important;
  color: var(--muted-foreground) !important;
  font-size: 14px !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 4px 6px !important;
  border-radius: var(--radius-sm) !important;
  transition: color 0.15s ease !important;
  float: none !important;
}

.filedrop .files .file .trash:hover,
.filedrop .files .file .pull-right.trash:hover,
.-redactor-container .filedrop .files .file .trash:hover,
.-redactor-container .filedrop .files .file .pull-right.trash:hover,
.-redactor-container + .filedrop .files .file .trash:hover,
.-redactor-container + .filedrop .files .file .pull-right.trash:hover {
  color: var(--destructive) !important;
}

/* Full picture tooltip on hover only */
.tooltip-preview,
.tooltip-preview img {
  max-width: 340px !important;
  max-height: 340px !important;
  width: auto !important;
  height: auto !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--modal-shadow) !important;
  z-index: 9999 !important;
  background: var(--card) !important;
}

.ui-tooltip.tooltip-preview {
  padding: 4px !important;
  border: 1px solid var(--border) !important;
  background: var(--card) !important;
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--modal-shadow) !important;
  z-index: 9999 !important;
}

/* Form Actions Bar */
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--background);
  border-top: 1px solid var(--border);
  gap: 16px;
  flex-wrap: wrap;
}

.form-security-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.form-security-note svg {
  color: var(--teal);
}

.action-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* Plain Reset Button */
.action-buttons input[type="reset"],
.action-buttons .btn-reset,
.action-buttons input.portal-button-ghost {
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  color: var(--muted-foreground) !important;
  font-weight: 500 !important;
  font-size: 13px !important;
  padding: 8px 14px !important;
  cursor: pointer !important;
  border-radius: var(--radius-sm) !important;
  transition: color 0.15s ease !important;
}

.action-buttons input[type="reset"]:hover,
.action-buttons .btn-reset:hover,
.action-buttons input.portal-button-ghost:hover {
  background: transparent !important;
  background-color: transparent !important;
  color: var(--foreground) !important;
  text-decoration: underline !important;
}

.action-buttons .submit-btn,
button.submit-btn {
  background: var(--primary) !important;
  color: #fff !important;
  border: 1px solid var(--primary) !important;
  font-weight: 600 !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

.action-buttons .submit-btn:hover,
button.submit-btn:hover {
  background: var(--primary-hover) !important;
  border-color: var(--primary-hover) !important;
  color: #fff !important;
}

/* Aside Guidance Card */
.form-aside {
  position: sticky;
  top: 100px;
}

.aside-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  box-shadow: var(--soft-shadow);
}

.aside-card .icon-tile {
  margin-bottom: 16px;
}

.aside-card h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 8px 0;
  line-height: 1.35;
}

.aside-card p {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.6;
  margin: 0 0 16px 0;
}

.aside-card ul {
  list-style: none;
  padding: 0;
  margin: 0 0 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.aside-card li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.5;
}

.aside-card li svg {
  color: var(--teal);
  flex-shrink: 0;
  margin-top: 2px;
}

.aside-divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.privacy-note svg {
  color: var(--muted-foreground);
  flex-shrink: 0;
  margin-top: 2px;
}

.privacy-note h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--foreground);
  margin: 0 0 4px 0;
}

.privacy-note p {
  font-size: 11px;
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.5;
}

/* ==========================================================================
   Footer Overrides
   ========================================================================== */
#footer,
footer#footer,
footer#site-footer,
.site-footer {
  margin-inline: auto !important;
  margin-top: auto !important;
  margin-bottom: 0 !important;
  padding: 24px 0 !important;
  border-top: 1px solid var(--border) !important;
  background: transparent !important;
  background-image: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  font-size: 11px !important;
  color: var(--muted-foreground) !important;
  text-align: left !important;
  box-shadow: none !important;
  width: calc(100% - 64px) !important;
  max-width: 1140px !important;
  box-sizing: border-box !important;
}

#footer p,
.site-footer p {
  margin: 0 !important;
  padding: 0 !important;
}

.footer-security {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
}

#footer #poweredBy,
#footer a#poweredBy,
#poweredByLink,
.powered-by-link {
  background: none !important;
  background-image: none !important;
  text-indent: 0 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  display: inline-flex !important;
  align-items: center !important;
  font-size: 11px !important;
  color: var(--muted-foreground) !important;
  text-decoration: none !important;
  border: none !important;
}

#footer #poweredBy:hover,
#footer a#poweredBy:hover,
#poweredByLink:hover,
.powered-by-link:hover {
  color: var(--primary) !important;
  text-decoration: underline !important;
}

/* ==========================================================================
   Responsive Breakpoints (Desktop, Tablet, Mobile)
   ========================================================================== */
@media (max-width: 1024px) {
  .portal-container,
  .site-footer {
    width: calc(100% - 48px) !important;
  }
}

@media (max-width: 900px) {
  .portal-container,
  .site-footer {
    width: calc(100% - 48px) !important;
  }
  .nav-security {
    display: none !important;
  }
  .welcome-decoration {
    display: none !important;
  }
  .form-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 24px !important;
  }
  .form-aside {
    position: static !important;
  }
}

@media (max-width: 768px) {
  .portal-container,
  .site-footer {
    width: calc(100% - 40px) !important;
  }
  .main-content {
    padding-block: 24px 40px !important;
  }
  .site-footer {
    width: calc(100% - 40px) !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    gap: 8px !important;
    padding: 20px 0 28px !important;
  }
  .site-footer > span,
  .site-footer a {
    text-align: center !important;
    font-size: 11px !important;
    justify-content: center !important;
  }
  .page-heading {
    margin-bottom: 22px !important;
  }
  .page-heading h1 {
    font-size: 24px !important;
  }
  .form-section {
    padding: 20px 18px !important;
  }
  .form-section-heading {
    gap: 10px !important;
    margin-bottom: 16px !important;
  }
  .form-section-heading h2 {
    font-size: 15px !important;
  }
  .contact-table tbody {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }
  .captcha-row {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .captcha-field-wrapper {
    flex: 1 1 100% !important;
    min-width: 100% !important;
    width: 100% !important;
  }
  .captcha-field input {
    max-width: 100% !important;
    width: 100% !important;
  }
  .form-actions {
    padding: 16px 18px !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 14px !important;
  }
  .form-security-note {
    order: 2 !important;
    justify-content: center !important;
  }
  .action-buttons {
    width: 100% !important;
    display: flex !important;
    flex-direction: column-reverse !important;
    gap: 8px !important;
    margin: 0 !important;
  }
  .action-buttons .portal-button,
  .action-buttons input,
  .action-buttons button {
    width: 100% !important;
    justify-content: center !important;
    text-align: center !important;
    min-height: 42px !important;
  }
  .verified-profile {
    flex-wrap: wrap !important;
    padding: 12px 14px !important;
    gap: 10px !important;
  }
  .verified-label {
    margin-left: 0 !important;
    width: 100% !important;
    padding-top: 4px !important;
  }
  .aside-card {
    padding: 22px 18px !important;
  }
}

@media (max-width: 640px) {
  .portal-container,
  .site-footer {
    width: calc(100% - 32px) !important;
  }
}

/* ==========================================================================
   Modern Alert & Notice Banners (#msg_error, #msg_notice, #msg_warning)
   ========================================================================== */
.portal-alert,
#msg_error,
#msg_notice,
#msg_warning,
.error-notice,
.warning-notice,
.success-notice {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  margin: 0 0 24px 0 !important;
  padding: 13px 18px !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  font-weight: 500 !important;
  line-height: 1.5 !important;
  box-sizing: border-box !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  height: auto !important;
  min-height: 46px !important;
}

.portal-alert .alert-icon {
  flex-shrink: 0 !important;
  width: 18px !important;
  height: 18px !important;
}

.portal-alert .alert-content {
  flex: 1 1 auto !important;
}

/* Error Alert */
.portal-alert-error,
#msg_error,
.error-notice {
  background: #fef2f2 !important;
  border: 1px solid #fecaca !important;
  color: #b91c1c !important;
}

.portal-alert-error .alert-icon,
#msg_error .alert-icon {
  color: #dc2626 !important;
}

/* Success Alert */
.portal-alert-success,
#msg_notice,
.success-notice {
  background: #f0fdf4 !important;
  border: 1px solid #bbf7d0 !important;
  color: #15803d !important;
}

.portal-alert-success .alert-icon,
#msg_notice .alert-icon {
  color: #16a34a !important;
}

/* Warning Alert */
.portal-alert-warning,
#msg_warning,
.warning-notice {
  background: #fffbeb !important;
  border: 1px solid #fde68a !important;
  color: #b45309 !important;
}

.portal-alert-warning .alert-icon,
#msg_warning .alert-icon {
  color: #d97706 !important;
}

/* Align alert banners cleanly with centered single-column layouts (e.g. Thank You page) */
#content:has(.ticket-success-wrapper) .portal-alert,
#content:has(.ticket-success-wrapper) #msg_notice,
#content:has(.ticket-success-wrapper) #msg_error,
#content:has(.ticket-success-wrapper) #msg_warning {
  max-width: 780px !important;
  margin: 0 auto 20px auto !important;
  box-sizing: border-box !important;
}

/* ==========================================================================
   Modern Submission Loading Modal (#overlay, #loading)
   ========================================================================== */
#overlay {
  display: none;
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(15, 23, 42, 0.5) !important;
  backdrop-filter: blur(4px) !important;
  -webkit-backdrop-filter: blur(4px) !important;
  z-index: 99998 !important;
  opacity: 1 !important;
}

#loading,
#loading.portal-loading-modal {
  display: none;
  position: fixed !important;
  top: 50% !important;
  left: 50% !important;
  transform: translate(-50%, -50%) !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  min-width: 320px !important;
  max-width: min(92vw, 420px) !important;
  height: auto !important;
  background: #ffffff !important;
  background-image: none !important;
  border: 1px solid rgba(226, 232, 240, 0.95) !important;
  border-radius: 16px !important;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.05) !important;
  z-index: 99999 !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
}

#loading .loading-content {
  display: flex !important;
  align-items: center !important;
  gap: 16px !important;
  padding: 22px 24px !important;
  box-sizing: border-box !important;
}

#loading .loading-spinner {
  flex-shrink: 0 !important;
  width: 38px !important;
  height: 38px !important;
  position: relative !important;
}

#loading .spinner-svg {
  width: 100% !important;
  height: 100% !important;
  animation: portal-spin 0.9s linear infinite !important;
}

#loading .spinner-track {
  stroke: #e2e8f0 !important;
}

#loading .spinner-head {
  stroke: var(--primary, #2563eb) !important;
  stroke-linecap: round !important;
  stroke-dasharray: 85, 150 !important;
  stroke-dashoffset: 0 !important;
}

@keyframes portal-spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

#loading .loading-text {
  display: flex !important;
  flex-direction: column !important;
  gap: 4px !important;
  text-align: left !important;
  min-width: 0 !important;
}

#loading h4 {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: #0f172a !important;
  line-height: 1.3 !important;
  font-family: inherit !important;
}

#loading p {
  margin: 0 !important;
  padding: 0 !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #64748b !important;
  line-height: 1.45 !important;
  font-family: inherit !important;
}

/* ==========================================================================
   Ticket Creation Success / Thank-You Page
   ========================================================================== */

.ticket-success-wrapper {
  max-width: 780px;
  margin: 16px auto 48px auto;
  padding: 0 16px;
  box-sizing: border-box;
}

.ticket-success-card {
  background: var(--card, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.04);
  padding: 40px 44px;
  box-sizing: border-box;
  text-align: left;
}

.ticket-success-header {
  text-align: center;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border, #e2e8f0);
  margin-bottom: 28px;
}

.ticket-success-icon-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #10b981;
  border: 1px solid #d1fae5;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
}

.ticket-success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--foreground, #0f172a);
  margin: 0 0 8px 0;
  line-height: 1.3;
  letter-spacing: -0.015em;
}

.ticket-success-subtitle {
  font-size: 14px;
  color: var(--muted-foreground, #64748b);
  margin: 0;
  line-height: 1.55;
}

.ticket-success-subtitle strong {
  color: var(--foreground, #0f172a);
  font-weight: 600;
}

/* Metadata Chips Grid */
.ticket-success-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  padding: 16px 20px;
  background: #f8fafc;
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-md, 10px);
  margin-bottom: 28px;
}

.ticket-meta-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ticket-meta-item .meta-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-foreground, #64748b);
}

.ticket-meta-item .meta-value {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--foreground, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ticket-meta-item .ticket-id-badge {
  display: inline-flex;
  align-items: center;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary, #2563eb);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 8px;
  border-radius: 6px;
  width: fit-content;
}

/* Dynamic CMS Body Content */
.ticket-success-body {
  font-size: 14.5px;
  line-height: 1.65;
  color: #334155;
  margin-bottom: 28px;
}

.ticket-success-body div {
  line-height: 1.65;
}

/* Style the guide callout card inside the body */
.ticket-success-body p {
  background: #ffffff;
  border: 1px solid var(--border, #e2e8f0);
  border-left: 4px solid var(--primary, #2563eb);
  border-radius: 8px;
  padding: 16px 18px;
  margin: 18px 0;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
  font-size: 13.5px;
  line-height: 1.6;
  color: #334155;
}

.ticket-success-body p strong {
  display: block;
  font-size: 14px;
  color: var(--foreground, #0f172a);
  margin-bottom: 5px;
}

.ticket-success-body a {
  color: var(--primary, #2563eb);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.ticket-success-body a:hover {
  color: var(--primary-hover, #1d4ed8);
}

/* Next Steps Info Box */
.ticket-success-next-steps {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius-md, 10px);
  padding: 18px 20px;
  margin-bottom: 32px;
}

.ticket-success-next-steps .next-step-icon {
  flex-shrink: 0;
  color: var(--primary, #2563eb);
  margin-top: 2px;
}

.ticket-success-next-steps .next-step-content {
  flex: 1 1 auto;
  font-size: 13px;
  line-height: 1.55;
  color: #1e3a8a;
}

.ticket-success-next-steps .next-step-content h4 {
  font-size: 14px;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0 0 6px 0;
}

.ticket-success-next-steps .next-step-content > p {
  margin: 0;
  color: #1e40af;
  line-height: 1.55;
}

.ticket-success-next-steps .next-step-content strong {
  color: #172554;
  font-weight: 600;
}

/* Callout notice for Do-Not-Reply warning */
.ticket-success-next-steps .next-step-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 14px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-left: 3.5px solid #d97706;
  border-radius: var(--radius-sm, 6px);
  box-sizing: border-box;
}

.ticket-success-next-steps .next-step-alert-icon {
  flex-shrink: 0;
  color: #d97706;
  margin-top: 1px;
  display: inline-flex;
}

.ticket-success-next-steps .next-step-alert-text {
  flex: 1 1 auto;
}

.ticket-success-next-steps .next-step-alert-text .alert-headline {
  margin: 0 0 4px 0 !important;
  font-size: 12.5px;
  line-height: 1.45;
  color: #92400e !important;
}

.ticket-success-next-steps .next-step-alert-text .alert-headline strong {
  color: #78350f !important;
  font-weight: 700;
}

.ticket-success-next-steps .next-step-alert-text .alert-sub {
  margin: 0 !important;
  font-size: 12px;
  line-height: 1.5;
  color: #92400e !important;
  opacity: 0.95;
}

/* Actions Group */
.ticket-success-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #e2e8f0);
}

.ticket-success-actions .portal-button-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

.ticket-success-actions .portal-link-subtle {
  margin-left: auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-foreground, #64748b);
  text-decoration: none;
  transition: color 0.15s ease;
}

.ticket-success-actions .portal-link-subtle:hover {
  color: var(--foreground, #0f172a);
  text-decoration: underline;
}

@media (max-width: 640px) {
  .ticket-success-card {
    padding: 24px 20px;
  }
  .ticket-success-title {
    font-size: 19px;
  }
  .ticket-success-next-steps {
    padding: 14px;
    gap: 10px;
  }
  .ticket-success-next-steps .next-step-alert {
    padding: 10px 12px;
    gap: 8px;
  }
  .ticket-success-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .ticket-success-actions .portal-button {
    width: 100%;
    justify-content: center;
  }
  .ticket-success-actions .portal-link-subtle {
    margin-left: 0;
    text-align: center;
    padding: 8px 0;
  }
}

/* ==========================================================================
   Shared #clientLogin / lookup error / bottom-help styles (login, pwreset, ticket status)
   ========================================================================== */

/* Aggressive neutralization of legacy theme.css #clientLogin styles */
#clientLogin,
form#clientLogin,
div#clientLogin {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  float: none !important;
  clear: none !important;
  display: block !important;
}

#clientLogin div,
#clientLogin label,
#clientLogin button,
#clientLogin p,
#clientLogin span {
  float: none !important;
  clear: none !important;
}

/* Neutralize legacy theme.css rule where #clientLogin strong had float: left & padding-left: 140px */
#clientLogin strong {
  float: none !important;
  clear: none !important;
  padding-left: 0 !important;
}

#clientLogin p {
  text-align: left !important;
  clear: none !important;
}

/* Universal high-specificity input styling for #clientLogin */
#clientLogin #email,
#clientLogin #ticketno,
#clientLogin input[type="text"],
#clientLogin input[type="email"],
#clientLogin input[type="password"] {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  float: none !important;
  margin-top: 8px !important;
  margin-right: 0 !important;
  margin-bottom: 0 !important;
  height: 46px !important;
  min-height: 46px !important;
  border: 1px solid var(--input) !important;
  border-radius: var(--radius-sm, 6px) !important;
  padding: 10px 16px !important;
  padding-left: 16px !important;
  padding-right: 16px !important;
  font-size: 14px !important;
  font-family: var(--font-sans) !important;
  color: var(--foreground) !important;
  background-color: var(--card) !important;
  line-height: normal !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  outline: none !important;
  box-shadow: none !important;
  display: block !important;
  clear: both !important;
}

#clientLogin input::placeholder {
  color: var(--muted-foreground) !important;
  opacity: 0.75 !important;
}

#clientLogin input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 3px var(--ring, rgba(37, 99, 235, 0.2)) !important;
}

#clientLogin div label {
  width: 100% !important;
  float: none !important;
}

.lookup-inline-error {
  display: flex;
  align-items: center;
  gap: 9px;
  background: var(--destructive-soft, #fef2f2);
  border: 1px solid #fecaca;
  color: var(--destructive, #b91c1c);
  padding: 10px 14px;
  border-radius: var(--radius-sm, 6px);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
}

.lookup-inline-error svg {
  flex-shrink: 0;
}

/* Bottom Help Link */
.bottom-help {
  font-size: 13px;
  color: var(--muted-foreground);
  margin: 34px 0 0 0;
  padding: 0;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}

.bottom-help a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--primary) !important;
  font-weight: 600;
  text-decoration: none !important;
  transition: color 0.15s ease;
}

.bottom-help a:hover {
  color: var(--primary-hover) !important;
  text-decoration: underline !important;
}

.bottom-help a svg {
  transition: transform 0.15s ease;
}

.bottom-help a:hover svg {
  transform: translateX(3px);
}

@media (max-width: 640px) {

  #clientLogin input[type="text"],
#clientLogin input[type="email"] {
    height: 46px !important;
    min-height: 46px !important;
    padding: 10px 16px !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    font-size: 13.5px !important;
  }

  .bottom-help {
    font-size: 12.5px !important;
    margin-top: 24px !important;
    justify-content: center !important;
    text-align: center !important;
  }
}

/* ==========================================================================
   Customer Ticket List Dashboard (tickets.php / tickets.inc.php)
   ========================================================================== */

/* Scope top spacing reduction when .ticket-list-wrapper is present */

/* Status Filter Tabs (Segmented Control) */

/* Card Container */

/* Filter Toolbar */

/* Clear Button */

/* Submit Search Button */

/* Help Topic Field */

/* Results & Info Bar */

/* Desktop Data Table */

/* Status Badges */
.ticket-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

.ticket-status-pill .status-indicator-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.ticket-status-pill.pill-open {
  color: #0d9488;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
}

.ticket-status-pill.pill-answered {
  color: #d97706;
  background: #fffbeb;
  border: 1px solid #fde68a;
}

.ticket-status-pill.pill-closed {
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
}

/* Subject & Topic Layout */

/* Mobile Stacking Cards (< 768px) */

/* Empty State */

/* Pagination Footer */

.ticket-page-nav-btn:hover:not(.is-disabled) {
  border: 1px solid var(--primary, #2563eb) !important;
  border-bottom: 1px solid var(--primary, #2563eb) !important;
  color: var(--primary, #2563eb) !important;
  background: var(--blue-soft, #eff6ff) !important;
  box-shadow: 0 1px 2px rgba(37, 99, 235, 0.08) !important;
}

.ticket-page-pill:hover:not(.is-active) {
  border: 1px solid var(--primary, #2563eb) !important;
  border-bottom: 1px solid var(--primary, #2563eb) !important;
  color: var(--primary, #2563eb) !important;
  background: var(--blue-soft, #eff6ff) !important;
}

/* Responsive Breakpoints */

/* ==========================================================================
   PORTAL CONTAINER & MAIN CONTENT RESPONSIVE MARGINS
   ========================================================================== */

#content.portal-container,
main#content.portal-container,
.main-content.portal-container {
  width: calc(100% - 64px) !important;
  max-width: 1140px !important;
  margin-inline: auto !important;
  box-sizing: border-box !important;
}

@media (max-width: 1024px) {
  #content.portal-container,
  main#content.portal-container,
  .main-content.portal-container {
    width: calc(100% - 48px) !important;
  }
}

@media (max-width: 768px) {
  #content.portal-container,
  main#content.portal-container,
  .main-content.portal-container {
    width: calc(100% - 40px) !important;
  }
}

@media (max-width: 640px) {
  #content.portal-container,
  main#content.portal-container,
  .main-content.portal-container {
    width: calc(100% - 32px) !important; /* Strict 16px min margins each side */
  }
}

/* ==========================================================================
   MINIMAL UNIFIED USER LOGIN OVERHAUL
   ========================================================================== */

.auth-page-header {
  margin: 0 auto 20px auto !important;
  max-width: 560px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  text-align: left !important;
}

.auth-page-header h1 {
  font-size: 24px !important;
  font-weight: 700 !important;
  color: var(--foreground, #0f172a) !important;
  margin: 0 0 6px 0 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.2px !important;
}

.auth-page-header .auth-page-sub {
  font-size: 14px !important;
  color: var(--muted-foreground, #64748b) !important;
  margin: 0 !important;
  line-height: 1.5 !important;
}

/* Unified Auth Container */

/* Unified Auth Card (Encloses both left form and right info in a single container) */

/* Left Form Pane */

.auth-field-group {
  margin-bottom: 16px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.auth-field-label {
  display: block !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--foreground, #0f172a) !important;
  margin-bottom: 6px !important;
  line-height: 1.3 !important;
}

/* Clean input styling (placeholder Email or Username, Password) */
#clientLogin input#username,
#clientLogin input#passwd {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  height: 46px !important;
  min-height: 46px !important;
  border: 1px solid var(--input, #cbd5e1) !important;
  border-radius: var(--radius-sm, 6px) !important;
  padding: 10px 16px !important;
  padding-left: 16px !important;
  font-size: 14px !important;
  font-family: var(--font-sans) !important;
  color: var(--foreground, #0f172a) !important;
  background-color: var(--card, #ffffff) !important;
  line-height: normal !important;
  transition: border-color 0.15s ease, box-shadow 0.15s ease !important;
  outline: none !important;
  margin: 0 !important;
}

#clientLogin input#username:focus,
#clientLogin input#passwd:focus {
  border-color: var(--primary, #2563eb) !important;
  box-shadow: 0 0 0 3px var(--ring, rgba(37, 99, 235, 0.2)) !important;
}

.auth-field-group.has-error input#username,
.auth-field-group.has-error input#passwd {
  border-color: var(--destructive, #b91c1c) !important;
}

.auth-field-group.has-error input#username:focus,
.auth-field-group.has-error input#passwd:focus {
  border-color: var(--destructive, #b91c1c) !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2) !important;
}

/* Password Toggle Container */

/* Options / Remember Me Row */

/* Actions Row (Sign In button + Forgot password link) */

/* Center Subtle Vertical Divider */

/* Right Elevated Action Tiles Pane */

/* External Auth */

/* Below Card Help Text */

/* ==========================================================================
   Responsive Breakpoints for Unified Auth Flow
   ========================================================================== */

/* Tablets (768px - 1024px) */

/* Mobile Devices (< 640px down to 320px) */
@media (max-width: 640px) {
  .auth-page-header h1 {
    font-size: 21px !important;
  }
  .auth-page-header .auth-page-sub {
    font-size: 13px !important;
  }

}

/* ==========================================================================
   PASSWORD RESET FLOW (pwreset.php, pwreset.request.php, pwreset.sent.php, pwreset.login.php)
   ========================================================================== */

.pwreset-container {
  width: 100% !important;
  max-width: 560px !important;
  margin: 0 auto !important;
  box-sizing: border-box !important;
}

.pwreset-card {
  background: var(--card, #ffffff) !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  border-bottom: 1px solid var(--border, #e2e8f0) !important;
  border-radius: var(--radius-lg, 12px) !important;
  box-shadow: var(--soft-shadow) !important;
  padding: 34px 36px !important;
  box-sizing: border-box !important;
  width: 100% !important;
  text-align: left !important;
}

.pwreset-icon-badge {
  width: 46px !important;
  height: 46px !important;
  border-radius: 10px !important;
  background: var(--blue-soft, #eff6ff) !important;
  color: var(--primary, #2563eb) !important;
  border: 1px solid var(--blue-border, #dbeafe) !important;
  border-bottom: 1px solid var(--blue-border, #dbeafe) !important;
  display: inline-grid !important;
  place-items: center !important;
  margin-bottom: 18px !important;
}

.pwreset-icon-badge.sent {
  background: var(--teal-soft, #f0fdfa) !important;
  color: var(--teal, #0d9488) !important;
  border: 1px solid var(--teal-border, #ccfbf1) !important;
  border-bottom: 1px solid var(--teal-border, #ccfbf1) !important;
}

.pwreset-icon-badge.confirmed {
  background: var(--emerald-soft, #ecfdf5) !important;
  color: #059669 !important;
  border: 1px solid #a7f3d0 !important;
  border-bottom: 1px solid #a7f3d0 !important;
}

.pwreset-header h2 {
  font-size: 19px !important;
  font-weight: 700 !important;
  color: var(--foreground, #0f172a) !important;
  margin: 0 0 8px 0 !important;
  line-height: 1.3 !important;
}

.pwreset-header p {
  font-size: 13.5px !important;
  color: var(--muted-foreground, #64748b) !important;
  margin: 0 0 20px 0 !important;
  line-height: 1.55 !important;
}

.confirm-content-body {
  font-size: 13.5px !important;
  color: var(--muted-foreground, #64748b) !important;
  line-height: 1.6 !important;
  margin: 0 0 20px 0 !important;
}

.confirm-content-body strong,
.confirm-content-body b {
  color: var(--foreground, #0f172a) !important;
  font-weight: 600 !important;
  display: inline-block !important;
  margin-bottom: 4px !important;
}

.confirm-content-body p {
  margin: 0 0 10px 0 !important;
}

.confirm-content-body p:last-child {
  margin-bottom: 0 !important;
}

.pwreset-form {
  width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
}

.pwreset-submit-btn {
  width: 100% !important;
  box-sizing: border-box !important;
  min-height: 44px !important;
  height: 44px !important;
  justify-content: center !important;
  font-size: 13.5px !important;
  font-weight: 600 !important;
  margin-top: 6px !important;
  border-radius: var(--radius-sm, 6px) !important;
}

.pwreset-card-footer {
  margin-top: 22px !important;
  padding-top: 18px !important;
  border-top: 1px solid var(--border, #f1f5f9) !important;
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
}

.pwreset-back-link {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  color: var(--primary, #2563eb) !important;
  text-decoration: none !important;
  transition: color 0.15s ease !important;
}

.pwreset-back-link:hover {
  color: var(--primary-hover, #1d4ed8) !important;
  text-decoration: underline !important;
}

.pwreset-footnote {
  text-align: center !important;
  font-size: 12.5px !important;
  color: var(--muted-foreground, #64748b) !important;
  margin: 22px auto 0 auto !important;
  line-height: 1.5 !important;
  max-width: 560px !important;
}

.pwreset-footnote a {
  color: var(--primary, #2563eb) !important;
  font-weight: 600 !important;
  text-decoration: none !important;
}

.pwreset-footnote a:hover {
  text-decoration: underline !important;
}

/* Sent Confirmation Card Specifics */
.pwreset-sent-notice {
  display: flex !important;
  align-items: flex-start !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  background: #f8fafc !important;
  border: 1px solid var(--border, #e2e8f0) !important;
  border-bottom: 1px solid var(--border, #e2e8f0) !important;
  border-radius: 8px !important;
  margin: 18px 0 24px 0 !important;
  text-align: left !important;
}

.sent-notice-icon {
  color: #3b82f6 !important;
  flex-shrink: 0 !important;
  margin-top: 2px !important;
}

.sent-notice-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  font-size: 12.5px !important;
  color: #475569 !important;
  line-height: 1.45 !important;
}

.sent-notice-content strong {
  color: var(--foreground, #0f172a) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.pwreset-sent-actions {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

.pwreset-action-btn {
  width: 100% !important;
  box-sizing: border-box !important;
  justify-content: center !important;
  min-height: 42px !important;
  height: 42px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

/* Responsive Breakpoints for Password Reset */
@media (max-width: 640px) {
  .pwreset-container {
    width: 100% !important;
    padding: 0 4px !important;
  }
  .pwreset-card {
    padding: 24px 20px !important;
    border-radius: var(--radius, 8px) !important;
  }
  .pwreset-header h2 {
    font-size: 17.5px !important;
  }
  .pwreset-header p {
    font-size: 13px !important;
  }
  .pwreset-footnote {
    font-size: 12px !important;
    margin-top: 18px !important;
  }
}

/* ==========================================================================
   HEADER: single sticky bar (brand lockup, pill nav, account)
   ========================================================================== */
#header,
header.site-header,
div#header {
  position: sticky !important;
  top: 0 !important;
  z-index: 50 !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  width: 100% !important;
  background: rgba(255, 255, 255, 0.86) !important;
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border) !important;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02) !important;
}

.header-inner {
  min-height: 80px;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 10px 0;
  box-sizing: border-box;
}

.brand-link,
#site-logo {
  display: inline-flex !important;
  align-items: center;
  gap: 14px;
  float: none !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  text-decoration: none !important;
  flex-shrink: 0;
}

.brand-link img,
#site-logo img {
  display: block;
  height: 64px !important;
  max-height: 64px !important;
  width: auto !important;
  max-width: 180px !important;
  object-fit: contain;
}

.brand-divider {
  width: 1px;
  height: 40px;
  background: var(--border);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 16px;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.2px;
}

.brand-text small {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

/* Pill navigation */
.primary-nav {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.nav-links-list {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 !important;
  padding: 4px !important;
  list-style: none !important;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}

.nav-links-list li {
  display: inline-flex;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  background: none !important;
}

.nav-links-list .nav-link {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  margin: 0 !important;
  border: none !important;
  border-radius: 999px;
  color: var(--muted-foreground) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.nav-links-list .nav-link:hover {
  color: var(--foreground) !important;
  background: rgba(255, 255, 255, 0.7);
}

.nav-links-list .nav-link.is-active,
.nav-links-list .nav-link.active {
  color: var(--primary) !important;
  background: var(--card);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08), 0 1px 2px rgba(15, 23, 42, 0.04);
}

.nav-links-list .nav-link svg {
  flex-shrink: 0;
}

/* Account area */
.account-area {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  margin-left: auto;
}

/* Account chip: avatar + name, opens the account menu */
.profile-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--card);
  font-family: var(--font-sans);
  text-decoration: none !important;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.profile-chip:hover,
.account-menu.is-open .profile-chip {
  border-color: var(--blue-border);
  background: #fbfdff;
}

.profile-chip:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--ring);
}

.account-menu .avatar {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
}

.guest-profile-badge .avatar {
  background: var(--secondary);
  color: var(--muted-foreground);
}

.profile-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.profile-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  white-space: nowrap;
}

.signin-btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 999px !important;
}

/* ==========================================================================
   BUTTON VARIANTS
   ========================================================================== */
.page-home #content .portal-button {
  border-radius: 10px;
  min-height: 44px;
  padding: 0 20px;
}

.portal-button-light {
  background: #ffffff !important;
  color: var(--primary) !important;
  border: 1px solid #ffffff !important;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.18) !important;
}

.portal-button-light:hover {
  background: #eff6ff !important;
  border: 1px solid #eff6ff !important;
  color: var(--primary-hover) !important;
}

.portal-button svg {
  transition: transform 0.18s ease;
}

.portal-button:hover svg {
  transform: translateX(2px);
}

/* ==========================================================================
   HOME: fits one viewport on desktop
   ========================================================================== */
.page-home #content.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(16px, 2.6vh, 24px);
  padding-block: clamp(18px, 3.5vh, 40px) !important;
}

.page-home .portal-shell {
  background:
    radial-gradient(900px 420px at 85% -10%, rgba(37, 99, 235, 0.08), transparent 70%),
    radial-gradient(700px 380px at -10% 110%, rgba(13, 148, 136, 0.06), transparent 70%);
}

/* Hero */
.home-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 32px;
  padding: clamp(22px, 3.6vh, 36px) clamp(24px, 3vw, 40px);
  border: 1px solid var(--border);
  border-radius: 20px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.6)),
    radial-gradient(circle at 1px 1px, rgba(37, 99, 235, 0.14) 1px, transparent 0) 0 0 / 22px 22px,
    linear-gradient(120deg, #ffffff 0%, #f5f9ff 55%, #eef4ff 100%);
  box-shadow: var(--soft-shadow);
  overflow: hidden;
}

.home-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -120px;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.16), transparent 65%);
  pointer-events: none;
}

.hero-copy {
  position: relative;
  z-index: 1;
  max-width: 620px;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--teal-border);
  border-radius: 999px;
  background: var(--teal-soft);
  color: #0f766e;
  font-size: 12px;
  font-weight: 600;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
  display: inline-block;
}

.home-hero h1 {
  margin: clamp(10px, 1.6vh, 16px) 0 8px !important;
  font-size: clamp(28px, 2.6vw + 6px, 40px) !important;
  font-weight: 750 !important;
  line-height: 1.12 !important;
  letter-spacing: -1px;
  color: var(--foreground) !important;
}

.text-accent {
  background: linear-gradient(90deg, #2563eb, #0d9488);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-hero p {
  margin: 0 !important;
  text-wrap: pretty;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-foreground) !important;
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px !important;
  max-width: 520px;
  padding: 5px 5px 5px 14px !important;
  background: var(--card);
  border: 1px solid var(--input);
  border-radius: 12px;
  box-shadow: var(--soft-shadow);
  color: var(--muted-foreground);
}

.hero-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--ring);
}

.hero-search input[type="text"] {
  flex: 1;
  min-width: 0;
  height: 36px;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  font: inherit;
  font-size: 14px;
  color: var(--foreground);
}

.hero-search button {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.hero-search button:hover {
  background: var(--primary-hover);
}

/* Hero right: ticket stats (signed-in) */
.hero-stats {
  position: relative;
  z-index: 1;
  width: 340px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--card-shadow);
}

.hero-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.hero-stats-head a {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--primary) !important;
  border: none !important;
  text-decoration: none !important;
  transition: color 0.15s ease;
}

.hero-stats-head a:hover {
  color: var(--primary-hover) !important;
}

.hero-stats-head a svg {
  transition: transform 0.15s ease;
}

.hero-stats-head a:hover svg {
  transform: translateX(2px);
}

.hero-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.stat-tile {
  display: flex !important;
  flex-direction: column;
  gap: 2px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  text-decoration: none !important;
  /* Only colour/shadow animate, so the tile never changes size on hover */
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.stat-tile:hover {
  border: 1px solid #bfdbfe; /* full shorthand: beats legacy theme.css a:hover dotted border */
  background-color: #fbfdff;
  box-shadow: 0 6px 16px -10px rgba(37, 99, 235, 0.35);
}

.stat-tile strong {
  font-size: 24px;
  font-weight: 750;
  line-height: 1.1;
  color: var(--foreground);
  font-variant-numeric: tabular-nums;
}

.stat-tile > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-foreground);
}

.stat-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #94a3b8;
}

.stat-tile.is-open .stat-dot { background: var(--primary); }
.stat-tile.is-closed .stat-dot { background: var(--teal); }

/* Hero right: illustration (guests) */
.hero-art {
  position: relative;
  z-index: 1;
  width: 170px;
  height: 140px;
}

.art-card {
  position: absolute;
  width: 104px;
  height: 128px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card);
}

.art-card-back {
  left: 52px;
  top: 4px;
  transform: rotate(10deg);
  background: var(--blue-soft);
  border-color: var(--blue-border);
}

.art-card-front {
  left: 20px;
  top: 8px;
  transform: rotate(-4deg);
  padding: 16px;
  box-sizing: border-box;
  box-shadow: var(--card-shadow);
}

.art-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 12px;
  border-radius: 10px;
  background: var(--blue-soft);
  color: var(--primary);
}

.art-line {
  display: block;
  height: 4px;
  width: 64px;
  margin: 7px 0;
  border-radius: 4px;
  background: var(--border);
}

.art-line.short { width: 40px; }

.art-badge {
  position: absolute;
  right: 8px;
  bottom: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 4px solid #fff;
  background: var(--teal-soft);
  color: var(--teal);
  box-shadow: var(--card-shadow);
}

/* Action cards */
.action-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.action-card {
  position: relative;
  display: flex !important;
  flex-direction: column;
  padding: clamp(18px, 3vh, 26px) 24px;
  background: var(--card);
  border: 1px solid var(--border) !important;
  border-radius: 18px;
  box-shadow: var(--soft-shadow);
  text-decoration: none !important;
  color: inherit;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
  overflow: hidden;
}

.action-card:hover {
  transform: none;
  border-color: #cbd5e1 !important;
  box-shadow: 0 12px 28px -12px rgba(15, 23, 42, 0.18);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: clamp(12px, 2vh, 18px);
}

/* `a .icon-tile`: the "icon-" prefix collides with Font Awesome's
   `a [class^="icon-"] { display: inline }`, which broke centering in link cards */
.icon-tile,
a .icon-tile {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--primary);
  flex-shrink: 0;
}

.icon-tile.teal { background: var(--teal-soft); color: var(--teal); }
.icon-tile.amber { background: #fff7ed; color: #ea580c; }

.step-label {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--secondary);
  color: var(--muted-foreground);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
}

.action-card h2 {
  margin: 0 0 6px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.2px;
  color: var(--foreground) !important;
}

.action-card p {
  flex: 1;
  margin: 0 !important;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted-foreground) !important;
}

.card-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: clamp(14px, 2.4vh, 22px);
}

.card-footnote {
  font-size: 11.5px;
  color: var(--muted-foreground);
}

/* Featured card */
.action-card.is-featured {
  border-color: transparent !important;
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 255, 255, 0.18), transparent 45%),
    linear-gradient(150deg, #1e40af 0%, #2563eb 55%, #3b82f6 100%);
  /* Paint under the transparent border too; otherwise the gradient tiles
     into the 1px border and shows a dark seam along the edges */
  background-origin: border-box;
  box-shadow: 0 14px 30px -14px rgba(37, 99, 235, 0.6);
}

.action-card.is-featured:hover {
  border-color: transparent !important;
  box-shadow: 0 20px 36px -14px rgba(37, 99, 235, 0.7);
}

.action-card.is-featured .icon-tile {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.action-card.is-featured .step-label {
  background: rgba(255, 255, 255, 0.16);
  color: #dbeafe;
}

.action-card.is-featured h2 { color: #fff !important; }
.action-card.is-featured p,
.action-card.is-featured .card-footnote { color: #dbeafe !important; }

/* Guide card */
.guide-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
}

.guide-cta svg { transition: transform 0.18s ease; }
.guide-card:hover h2 { color: var(--primary) !important; }
.guide-card:hover .guide-cta svg { transform: translate(2px, -2px); }

/* Assurance strip */
.assurance-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.7);
}

.assurance-row > div {
  display: flex;
  align-items: center;
  gap: 12px;
}

.assurance-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--teal-soft);
  color: var(--teal);
  flex-shrink: 0;
}

.assurance-row strong {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--foreground);
}

.assurance-row small {
  display: block;
  font-size: 11.5px;
  color: var(--muted-foreground);
}

.home-kb h2 {
  font-size: 18px !important;
  font-weight: 700 !important;
  color: var(--foreground) !important;
  margin: 8px 0 12px !important;
}

/* Footer: slim */
#footer,
footer#site-footer,
.site-footer {
  padding: 16px 0 !important;
  gap: 16px;
  font-size: 12px !important;
}

/* ==========================================================================
   HEADER / HOME: responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .profile-meta { display: none; }
  .profile-chip { padding: 3px 8px 3px 3px; gap: 6px; }
  .brand-divider, .brand-text { display: none; }
}

@media (max-width: 1024px) {
  .action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-card { grid-column: 1 / -1; }
  .hero-stats { width: 300px; }
}

@media (max-width: 860px) {
  #header, header.site-header { position: static !important; }
  .header-inner {
    flex-wrap: wrap;
    gap: 10px 16px;
    min-height: 0;
    padding: 10px 0 12px;
  }
  .brand-link img, #site-logo img {
    height: 46px !important;
    max-height: 46px !important;
  }
  .brand-divider, .brand-text { display: flex; }
  .brand-divider { height: 28px; }
  .primary-nav {
    order: 3;
    flex: 1 1 100%;
    justify-content: flex-start;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .primary-nav::-webkit-scrollbar { display: none; }
  .nav-links-list { width: 100%; justify-content: space-between; box-sizing: border-box; }
  .nav-links-list li { flex: 1; }
  .nav-links-list .nav-link { width: 100%; justify-content: center; padding: 0 12px; }

  .page-home #content.main-content { justify-content: flex-start; }
  .home-hero { grid-template-columns: minmax(0, 1fr); }
  .hero-art { display: none; }
  .hero-stats { width: auto; }
}

@media (max-width: 640px) {
  .action-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .guide-card { grid-column: auto; }
  .card-actions .portal-button { width: 100%; box-sizing: border-box; }
  .assurance-row { grid-template-columns: minmax(0, 1fr); padding: 14px 16px; }
  .home-hero { padding: 22px 18px; }
  .home-hero p { font-size: 14px; }
  .action-card, .home-hero { border-radius: 16px; }
}

@media (max-width: 480px) {
  .brand-divider, .brand-text { display: none; }
  .nav-links-list .nav-link {
    height: 40px;
    padding: 0 8px;
    font-size: 12px;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }
  .nav-links-list .nav-link svg { display: none; }
}

/* Short desktop screens: tighten so the home page still fits without scrolling */
@media (min-width: 861px) and (max-height: 760px) {
  .header-inner { min-height: 64px; padding: 6px 0; }
  .brand-link img, #site-logo img { height: 56px !important; max-height: 56px !important; }
  .page-home #content.main-content { gap: 14px; padding-block: 14px !important; }
  .home-hero { padding: 18px 28px; }
  .home-hero h1 { font-size: 30px !important; }
  .action-card p { font-size: 13px; line-height: 1.5; }
  .assurance-row { padding: 10px 18px; }
  .assurance-icon { width: 30px; height: 30px; }
  #footer, footer#site-footer, .site-footer { padding: 10px 0 !important; }
}

/* Very short desktop screens (e.g. 1366x768 with browser toolbars) */
@media (min-width: 861px) and (max-height: 680px) {
  .header-inner { min-height: 58px; padding: 4px 0; }
  .brand-link img, #site-logo img { height: 50px !important; max-height: 50px !important; }
  .page-home #content.main-content { gap: 12px; padding-block: 12px !important; }
  .home-hero { padding: 14px 28px; }
  .home-hero h1 { font-size: 28px !important; margin: 8px 0 4px !important; }
  .hero-art { transform: scale(0.8); margin: -14px 0; }
  .action-card { padding: 16px 22px; }
  .card-top { margin-bottom: 10px; }
  .card-actions { margin-top: 12px; gap: 6px; }
  .assurance-row { padding: 8px 18px; }
}

/* Home: hover must never shift layout.
   Legacy theme.css toggles a { margin-bottom: 1px } -> 0 on hover, which resized the
   vertically-centred home content; lifts also flickered when the cursor sat on an edge. */
.page-home .action-card,
.page-home .action-card:hover,
.page-home #content .portal-button,
.page-home #content .portal-button:hover,
.page-home .stat-tile,
.page-home .stat-tile:hover,
.page-home .hero-stats-head a,
.page-home .hero-stats-head a:hover,
.site-header a,
.site-header a:hover {
  margin: 0 !important;
}

.page-home #content .portal-button:hover,
.page-home #content .portal-button-light:hover,
.page-home #content .portal-button-outline:hover {
  transform: none !important;
}

.page-home .action-card {
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.page-home .action-card:hover {
  border-color: var(--blue-border) !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.06), 0 14px 30px -14px rgba(15, 23, 42, 0.22);
}

.page-home .action-card.is-featured:hover {
  border-color: transparent !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.14), 0 18px 34px -14px rgba(37, 99, 235, 0.65);
}

/* ==========================================================================
   Split card layout (.split-*): shared by Check Ticket Status + Sign In
   ========================================================================== */
.split-page {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - 230px);
  padding: 8px 0 4px;
}

.split-page::before {
  content: "";
  position: absolute;
  inset: -40px -10% auto;
  height: 420px;
  z-index: -1;
  background:
    radial-gradient(600px 300px at 30% 30%, rgba(37, 99, 235, 0.10), transparent 70%),
    radial-gradient(500px 280px at 75% 60%, rgba(13, 148, 136, 0.08), transparent 70%);
  pointer-events: none;
}

.split-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  width: 100%;
  max-width: 940px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: var(--card);
  box-shadow:
    0 1px 2px rgba(15, 23, 42, 0.04),
    0 24px 48px -24px rgba(15, 23, 42, 0.18);
}

.split-shell.is-single {
  grid-template-columns: minmax(0, 1fr);
  max-width: 520px;
}

/* Form side */
.split-main {
  padding: 36px 40px;
}

.split-badge {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  margin-bottom: 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #fff;
  box-shadow: 0 10px 20px -8px rgba(37, 99, 235, 0.55);
}

.split-main h1 {
  margin: 0 0 6px !important;
  font-size: 24px !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.5px;
  color: var(--foreground) !important;
}

.split-lead {
  margin: 0 0 24px !important;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted-foreground) !important;
}

.split-main .lookup-inline-error {
  margin: -8px 0 18px;
}

.split-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.split-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 42px;
  margin-top: 4px;
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(180deg, #3b82f6 0%, #2563eb 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 8px 18px -8px rgba(37, 99, 235, 0.7);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

.split-submit:hover {
  background: linear-gradient(180deg, #2f74f0 0%, #1d4ed8 100%);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset, 0 10px 22px -8px rgba(37, 99, 235, 0.8);
}

.split-submit:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25);
}

.split-submit svg {
  transition: transform 0.15s ease;
}

.split-submit:hover svg {
  transform: translateX(2px);
}

.split-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: -4px 0 0 !important;
  font-size: 12px;
  color: var(--muted-foreground) !important;
}

.split-note svg {
  flex-shrink: 0;
  color: var(--teal);
}

/* Account side: soft, low-contrast panel so the form stays the focus */
.split-side {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 36px 36px 28px;
  border-left: 1px solid var(--border);
  background:
    radial-gradient(circle at 1px 1px, rgba(100, 116, 139, 0.14) 1px, transparent 0) 0 0 / 20px 20px,
    #f8fafc;
}

.split-side-inner {
  position: relative;
}

.split-side-badge {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border: 1px solid var(--teal-border);
  border-radius: 12px;
  background: var(--teal-soft);
  color: var(--teal);
}

.split-side h2 {
  margin: 0 0 8px !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  line-height: 1.3 !important;
  letter-spacing: -0.3px;
  color: var(--foreground) !important;
}

.split-side p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--muted-foreground) !important;
}

.split-side-button {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  height: 40px;
  margin-top: 22px;
  padding: 0 18px;
  box-sizing: border-box;
  border: 1px solid var(--input);
  border-radius: 10px;
  background: #fff;
  color: var(--foreground) !important;
  font-size: 13.5px;
  font-weight: 600;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
  transition: border-color 0.15s ease, color 0.15s ease;
}

.split-side-button:hover {
  border-color: #93c5fd;
  color: var(--primary) !important;
}

.split-side-button svg {
  transition: transform 0.15s ease;
}

.split-side-button:hover svg {
  transform: translateX(2px);
}

.split-side .split-side-register {
  margin-top: 14px;
  font-size: 13px;
}

.split-side-register a {
  color: var(--primary) !important;
  font-weight: 600;
  text-decoration: none !important;
}

.split-side-register a:hover {
  text-decoration: underline !important;
}

.split-side .split-side-foot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--muted-foreground) !important;
}

.split-side-foot svg {
  flex-shrink: 0;
  color: var(--teal);
}

.split-page .split-help {
  justify-content: center;
  margin-top: 20px;
}

@media (max-width: 860px) {
  .split-page {
    min-height: 0;
  }
  .split-shell {
    grid-template-columns: minmax(0, 1fr);
    max-width: 560px;
  }
  .split-side {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 640px) {
  .split-shell {
    border-radius: 18px;
  }
  .split-main {
    padding: 26px 20px;
  }
  .split-side {
    padding: 26px 20px 22px;
  }
  .split-side-button {
    width: 100%;
    justify-content: center;
    box-sizing: border-box;
  }
}

/* Split card: extras used by Sign In (login.inc.php) */
.split-lead p {
  margin: 0;
}

.split-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: -2px;
}

.split-text-link {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary) !important;
  text-decoration: none !important;
}

.split-text-link:hover {
  text-decoration: underline !important;
}

.split-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted-foreground);
}

.split-divider::before,
.split-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.split-external {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.split-side-label {
  display: block;
  margin-bottom: 14px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.split-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.split-link {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border) !important;
  border-radius: 12px;
  background: #fff;
  text-decoration: none !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.split-link:hover {
  border-color: #bfdbfe !important;
  box-shadow: 0 6px 16px -10px rgba(37, 99, 235, 0.45);
}

.split-link-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.split-link-icon.teal { background: var(--teal-soft); color: var(--teal); }
.split-link-icon.blue { background: var(--blue-soft); color: var(--primary); }
.split-link-icon.slate { background: #f1f5f9; color: #475569; }

.split-link-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.split-link-text strong {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--foreground);
}

.split-link-text small {
  font-size: 12px;
  color: var(--muted-foreground);
}

.split-link-chevron {
  flex-shrink: 0;
  color: #94a3b8;
  transition: transform 0.15s ease, color 0.15s ease;
}

.split-link:hover .split-link-chevron {
  color: var(--primary);
  transform: translateX(2px);
}

.split-link:hover strong {
  color: var(--primary);
}

.split-page .split-help {
  max-width: 940px;
  text-align: center;
}


/* ==========================================================================
   Profile (profile.inc.php)
   ========================================================================== */
/* Settings layout: section title on the left, fields on the right,
   so the card uses the full page width evenly */
.ticket-form.profile-form .form-section {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
  padding: 28px 32px !important;
}

.ticket-form.profile-form .form-section-heading {
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin: 0 !important;
  padding-top: 2px;
}

.profile-form .form-section-heading .section-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.profile-form .form-section-heading h2 {
  flex: none;
}

.profile-form .required-note {
  margin-left: 0;
}

.ticket-form.profile-form .form-actions {
  padding: 16px 32px !important;
}

/* Small icon tile used in place of the 01/02 number on settings-style forms */
.section-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--primary);
  flex-shrink: 0;
}


/* Two-column field grid; dynamic form rows flow into it too */
.profile-grid,
.profile-fields tbody {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 20px;
}

.profile-grid-full,
.profile-fields .ui-form-header-row,
.profile-fields .ui-row-threadentry,
.profile-fields .ui-row-textarea,
.profile-fields .ui-row-sectionbreak,
.profile-fields .ui-row-freetext {
  grid-column: 1 / -1;
}

.ui-form .profile-fields td {
  padding: 0 !important;
}

/* Hide the empty grey header the form template prints when it has no instructions */
.profile-fields .ui-form-header-row:has(.form-header h3:empty):has(.form-header div:empty) {
  display: none !important;
}

/* Time zone: osTicket's select2 picker + Auto Detect button */
.profile-timezone {
  display: flex;
  align-items: center;
  gap: 8px;
}

.profile-timezone .select2-container {
  flex: 1;
  min-width: 0;
  width: auto !important;
}

.profile-timezone .action-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: var(--ui-control-h);
  padding: 0 14px;
  border: 1px solid var(--ui-border);
  border-radius: var(--ui-radius);
  background: #fff;
  color: var(--foreground);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  vertical-align: middle !important;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.profile-timezone .action-button:hover {
  border-color: #93c5fd;
  color: var(--primary);
}

.profile-timezone .action-button i {
  color: var(--primary);
}

@media (max-width: 900px) {
  .ticket-form.profile-form .form-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    padding: 22px 20px !important;
  }
  .ticket-form.profile-form .form-section-heading {
    flex-direction: row;
    align-items: center;
  }
  .profile-form .form-section-heading .section-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
  }
  .profile-form .required-note {
    margin-left: auto;
  }
  .ticket-form.profile-form .form-actions {
    padding: 16px 20px !important;
  }
}

@media (max-width: 720px) {
  .profile-grid,
  .profile-fields tbody {
    grid-template-columns: minmax(0, 1fr);
  }
  .profile-timezone {
    flex-wrap: wrap;
  }
  .profile-timezone .select2-container {
    flex-basis: 100%;
  }
}


/* ==========================================================================
   Ticket view (view.inc.php + templates/thread-entry|event.tmpl.php)
   ========================================================================== */
.tv-breadcrumb {
  margin-bottom: 8px;
}

.tv-callout {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px 16px;
  border: 1px solid var(--blue-border);
  border-radius: 12px;
  background: var(--blue-soft);
  font-size: 13px;
  color: var(--foreground);
}

.tv-callout-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: #fff;
  color: var(--primary);
  flex-shrink: 0;
}

.tv-callout p {
  margin: 2px 0 0 !important;
  color: var(--muted-foreground) !important;
}

.tv-callout a {
  color: var(--primary) !important;
  font-weight: 600;
}

/* Heading */
.tv-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.tv-head-main {
  min-width: 0;
}

.tv-head .ticket-subject-title {
  margin: 0 !important;
  font-size: 24px !important;
  font-weight: 750 !important;
  line-height: 1.25 !important;
  letter-spacing: -0.4px;
  color: var(--foreground) !important;
  word-break: break-word;
  min-width: 0;
}

.tv-head-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.tv-head-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.tv-head-actions .ui-icon-button {
  width: var(--ui-control-h);
  height: var(--ui-control-h);
  text-decoration: none !important;
}

.tv-btn {
  display: inline-flex !important;
  align-items: center;
  gap: 7px;
  height: var(--ui-control-h);
  min-height: 0 !important;
  padding: 0 16px !important;
  box-sizing: border-box;
  border-radius: var(--ui-radius) !important;
  font-size: 13.5px !important;
}

/* Layout: conversation + sticky details sidebar */
.tv-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  gap: 24px;
  align-items: start;
}

.tv-main,
.tv-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.tv-side {
  position: sticky;
  top: 100px;
}

.tv-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--soft-shadow);
}

.tv-card-head {
  padding: 16px 20px;
  border-bottom: 1px solid #eef2f6;
}

.tv-card-head h2 {
  margin: 0 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
  color: var(--foreground) !important;
}

.tv-card-head p {
  margin: 4px 0 0 !important;
  font-size: 12.5px;
  color: var(--muted-foreground) !important;
}

.tv-card-head-sm {
  padding: 12px 18px;
}

.tv-card-head-sm h3 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted-foreground) !important;
}

.tv-card-head-sm h3 svg {
  color: var(--primary);
}

/* Label / value rows: one shared grid so every value lines up */
.tv-details {
  margin: 0;
  padding: 6px 18px 10px;
}

.tv-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid #f1f5f9;
}

.tv-row:last-child {
  border-bottom: none;
}

.tv-row dt {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

.tv-row dd {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--foreground);
  word-break: break-word;
  min-width: 0;
}

.tv-row dd .ui-badge {
  vertical-align: middle;
}

.tv-email {
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 0 1 auto;
  cursor: default;
}

.tv-email-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
}

.tv-copy-btn {
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  border: 1px solid #e2e8f0;
  border-radius: 5px;
  background: #ffffff;
  color: var(--muted-foreground);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
  box-sizing: border-box;
}

.tv-copy-btn:hover {
  background: #f1f5f9;
  color: var(--foreground);
  border-color: #cbd5e1;
}

.tv-copy-btn:active {
  transform: scale(0.94);
}

.tv-copy-btn.copied {
  color: #10b981;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.tv-copy-btn .ui-icon {
  display: block;
}

.tv-details-stacked .tv-row {
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
}

.tv-rich {
  font-weight: 500;
  line-height: 1.55;
}

.tv-rich p {
  margin: 0 0 6px;
}

/* Conversation timeline */
#ticketThread {
  position: relative;
  padding: 20px;
  border: none !important;
}

#ticketThread::before {
  content: "";
  position: absolute;
  margin: 0 !important;
  border: none !important;
  left: 37px;
  top: 28px;
  bottom: 28px;
  width: 2px;
  border-radius: 2px;
  background: #eef2f6;
}

.tl-entry {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  margin: 0 0 18px;
}

.tl-avatar {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px var(--card);
  overflow: hidden;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, #94a3b8, #64748b);
}

.tl-avatar.is-staff {
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
}

.tl-avatar.is-client {
  background: linear-gradient(135deg, #14b8a6, #0f766e);
}

.tl-avatar .avatar,
.tl-avatar img {
  display: block;
  width: 36px !important;
  height: 36px !important;
  border-radius: 50%;
  object-fit: cover;
}

.tl-card {
  min-width: 0;
  border: 1px solid #e8edf3;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}

.tl-entry.is-staff .tl-card {
  border-color: #dbeafe;
  background: #fbfdff;
}

.tl-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  padding: 10px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.tl-entry.is-staff .tl-head {
  border-bottom-color: #e6efff;
}

.tl-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--foreground);
}

.tl-role {
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.tl-entry.is-staff .tl-role {
  background: #e0ecff;
  color: #1d4ed8;
}

.tl-title {
  min-width: 0;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

.tl-time {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 12px;
  color: var(--muted-foreground);
  white-space: nowrap;
}

.tl-edited {
  padding: 1px 6px;
  border-radius: 4px;
  background: #fffbeb;
  color: #b45309;
  font-size: 11px;
  font-weight: 600;
}

.tl-head .textra:empty {
  display: none;
}

.tl-body {
  padding: 14px 16px !important;
  font-size: 14px;
  line-height: 1.6;
  color: var(--foreground);
  overflow-x: auto;
}

.tl-content > :first-child {
  margin-top: 0 !important;
}

.tl-content > :last-child {
  margin-bottom: 0 !important;
}

.tl-content p {
  margin: 0 0 8px;
}

.tl-content img {
  max-width: 100%;
  height: auto;
}

.tl-content blockquote {
  margin: 8px 0;
  padding: 6px 12px;
  border-left: 3px solid var(--border);
  color: var(--muted-foreground);
}

/* Attachments (thread entries + custom form file fields) */
.tl-attachments {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #e2e8f0;
}

.attachments-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.attachment-chip {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 5px 10px;
  border: 1px solid var(--border) !important;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--foreground) !important;
  text-decoration: none !important;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.attachment-chip:hover {
  border-color: #bfdbfe !important;
  background: #eff6ff;
}

.attachment-chip svg {
  flex-shrink: 0;
  color: var(--primary);
}

.attachment-chip .attachment-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attachment-chip small {
  color: var(--muted-foreground);
  font-size: 11px;
}

/* Status events ("Created by …", "Closed by …") */
.tl-event {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  margin: 0 0 18px;
  font-size: 12.5px;
  color: var(--muted-foreground);
}

.tl-event-icon {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: 4px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 4px var(--card);
  color: var(--muted-foreground);
  font-size: 12px;
}

.tl-event .description {
  line-height: 1.5;
}

.tl-event .description b,
.tl-event .description strong {
  color: var(--foreground);
  font-weight: 600;
}

.tl-event img.avatar {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50%;
  vertical-align: middle;
  margin: 0 2px;
}

#ticketThread > :last-child {
  margin-bottom: 0;
}

/* Reply */
#reply-box #reply {
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
}

.tv-reply-body {
  padding: 16px 20px;
}

.tv-reply-attachments {
  margin-top: 10px;
}

.tv-reply-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  background: #fffbeb;
  color: #b45309;
  font-size: 12.5px;
}

.reply-error-msg {
  color: var(--destructive);
  font-weight: 600;
}

.tv-reply-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid #eef2f6;
  border-radius: 0 0 14px 14px;
  background: #fbfcfe;
}

.tv-reply-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.tv-reply-actions .btn-reset {
  padding: 8px 12px;
  border: none !important;
  background: transparent !important;
  color: var(--muted-foreground) !important;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.tv-reply-actions .btn-reset:hover {
  color: var(--foreground) !important;
}

.reply-alert {
  margin: 0 !important;
}

@media (max-width: 1024px) {
  .tv-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .tv-side {
    position: static;
    order: -1;
  }
}

@media (max-width: 640px) {
  .tv-head {
    flex-direction: column;
    align-items: flex-start;
  }
  .tv-head .ticket-subject-title {
    font-size: 20px !important;
  }
  #ticketThread {
    padding: 16px 12px;
  }
  #ticketThread::before {
    left: 29px;
  }
  .tl-entry,
  .tl-event {
    gap: 10px;
  }
  .tl-time {
    margin-left: 0;
    width: 100%;
  }
  .tv-reply-footer {
    flex-direction: column-reverse;
    align-items: stretch;
  }
  .tv-reply-actions {
    justify-content: flex-end;
  }
}

/* Legacy clearfix pseudo-elements on .thread-entry would become grid cells */
.tl-entry::before,
.tl-entry::after,
.tl-event::before,
.tl-event::after {
  content: none !important;
  display: none !important;
}

/* Neutralise legacy theme.css borders inside the new timeline / reply card */
.thread-entry .tl-body {
  border: none !important;
  background: transparent !important;
  border-radius: 0 !important;
}

#reply .tv-card-head h2 {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
}

/* Generic message/article body (FAQ articles, thread entries) */
.thread-body {
  border: none;
  font-size: 13.5px;
  line-height: 1.6;
  color: #1e293b;
}

.thread-body blockquote {
  margin: 8px 0;
  padding: 8px 12px;
  border-left: 3px solid #cbd5e1;
  border-radius: 0 6px 6px 0;
  background: #f8fafc;
  color: #475569;
  font-style: normal;
}

.thread-body blockquote p {
  margin: 0;
}
