:root {
  color-scheme: light;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #172033;
  --muted: #667085;
  --line: #d9dee8;
  --accent: #246b55;
  --accent-strong: #174c3c;
  --amber: #af6b00;
  --red: #b42318;
  --blue: #245da8;
  --shadow: 0 18px 45px rgba(21, 32, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Nirmala UI", "Segoe UI Symbol", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

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

button {
  cursor: pointer;
}

.is-hidden {
  display: none !important;
}

.login-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(135deg, #10241f 0%, #1f4d42 46%, #f7f8fb 46%, #f7f8fb 100%);
}

.login-card {
  width: min(100%, 430px);
  display: grid;
  gap: 18px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.login-brand {
  color: var(--text);
  border-bottom-color: var(--line);
}

.login-brand span {
  color: var(--muted);
}

.login-card h1 {
  font-size: 2rem;
  margin-bottom: 6px;
}

.login-card p {
  color: var(--muted);
  margin-bottom: 0;
}

.form-error {
  min-height: 20px;
  color: var(--red);
  font-weight: 700;
  margin: 0;
}

.app-shell {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  background: #10241f;
  color: #f5fbf8;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-link {
  color: inherit;
  text-decoration: none;
}

.brand-link:hover {
  color: inherit;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #d9f2e8;
  object-fit: contain;
  padding: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #bed1ca;
  font-size: 0.88rem;
  margin-top: 2px;
}

.field-label,
label span {
  color: inherit;
  display: block;
  font-weight: 700;
  font-size: 0.86rem;
  margin-bottom: 8px;
}

.input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--text);
  background: #fff;
  outline: none;
}

textarea.input {
  resize: vertical;
  line-height: 1.45;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(36, 107, 85, 0.15);
}

.role-card {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #d9e8e3;
  line-height: 1.45;
}

.signed-user {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 8px;
  background: #f5fbf8;
  color: #10241f;
  font-weight: 800;
}

.role-card strong {
  color: #fff;
  display: block;
  margin-bottom: 4px;
}

.tabs {
  display: grid;
  gap: 8px;
  margin-top: 4px;
}

.tab,
.segment,
.date-today-button {
  border: 0;
  border-radius: 8px;
  min-height: 40px;
  padding: 10px 12px;
  text-align: left;
}

.tab {
  background: transparent;
  color: #d8e8e2;
  position: relative;
}

.tab.is-active,
.tab:hover {
  background: #d9f2e8;
  color: #10241f;
}

.stock-search-link {
  min-height: 40px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #d8e8e2;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.88rem;
}

.stock-search-link:hover {
  background: #d9f2e8;
  color: #10241f;
}

.notification-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.notification-bell {
  position: relative;
  width: 17px;
  height: 17px;
  border: 2px solid currentColor;
  border-bottom-width: 3px;
  border-radius: 9px 9px 5px 5px;
  opacity: 0;
  transform-origin: top center;
}

.notification-bell::before {
  content: "";
  position: absolute;
  top: -5px;
  left: 4px;
  width: 5px;
  height: 4px;
  border: 2px solid currentColor;
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
}

.notification-bell::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: -7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

.notification-tab.has-unread .notification-bell {
  opacity: 1;
  color: #f59e0b;
  animation: bellBlink 0.9s ease-in-out infinite;
}

.notification-tab.has-unread::after {
  content: attr(data-count);
  position: absolute;
  top: 4px;
  right: 5px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  font-size: 0.68rem;
  font-weight: 900;
}

@keyframes bellBlink {
  0%, 100% {
    transform: rotate(0deg) scale(1);
    opacity: 1;
  }
  25% {
    transform: rotate(-12deg) scale(1.06);
  }
  50% {
    opacity: 0.35;
  }
  75% {
    transform: rotate(12deg) scale(1.06);
  }
}

.main {
  padding: 18px 28px 28px;
  overflow: hidden;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 14px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  margin-bottom: 0;
}

h2 {
  margin-bottom: 6px;
  font-size: 1.2rem;
}

.stats-strip,
.report-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 8px;
}

.stat,
.panel,
.task-card,
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.stat {
  min-width: 120px;
  padding: 10px 12px;
}

.stat strong {
  display: block;
  font-size: 1.25rem;
}

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

.view {
  display: none;
}

.view.is-visible {
  display: block;
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  margin-bottom: 14px;
}

.task-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: end;
}

.date-picker {
  min-width: 180px;
}

.date-today-button {
  min-width: 82px;
  background: #d9f2e8;
  color: var(--accent-strong);
  font-weight: 800;
  text-align: center;
}

.segmented {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: #e9edf3;
  border-radius: 8px;
  min-width: min(100%, 420px);
}

.segment {
  flex: 1;
  text-align: center;
  background: transparent;
  color: var(--muted);
  white-space: nowrap;
}

.segment.is-active {
  color: var(--accent-strong);
  background: #d9f2e8;
  box-shadow: 0 2px 8px rgba(21, 32, 51, 0.12);
}

.search {
  max-width: 320px;
}

.task-list {
  display: grid;
  gap: 12px;
}

.new-task-notice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid #a7d8c8;
  border-radius: 8px;
  background: #edf8f4;
  color: var(--accent-strong);
}

.new-task-notice strong {
  display: block;
  margin-bottom: 4px;
}

.new-task-notice ul {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
}

.notification-panel {
  max-width: 760px;
}

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

.notification-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.notification-card.is-unread {
  border-color: #f59e0b;
  background: #fff8eb;
}

.notification-card strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.notification-card span,
.notification-card p {
  color: var(--muted);
  font-size: 0.88rem;
}

.notification-card p {
  margin-top: 6px;
}

.notification-status {
  padding: 5px 8px;
  border-radius: 999px;
  background: #edf2f7;
  font-weight: 900;
  color: var(--muted);
}

.notification-card.is-unread .notification-status {
  background: #fee2e2;
  color: #b42318;
}

.task-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 16px;
}

.task-card.is-view-only {
  background: #fbfcfe;
}

.task-card h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.task-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.task-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
  background: #eef2f6;
  color: #344054;
}

.pill.high {
  background: #fff0e1;
  color: var(--amber);
}

.pill.done {
  background: #e8f5ee;
  color: var(--accent);
}

.pill.hold {
  background: #fff7d6;
  color: #8a5a00;
}

.pill.completed-by {
  background: #f2eefb;
  color: #5b3b92;
}

.pill.open {
  background: #eaf1fb;
  color: var(--blue);
}

.complete-button,
.hold-button,
.secondary-action-button,
.primary-button,
.secondary-button,
.danger-button {
  border: 0;
  border-radius: 8px;
  font-weight: 800;
}

.complete-button {
  align-self: start;
  min-height: 34px;
  padding: 7px 10px;
  background: #e8f5ee;
  color: var(--accent-strong);
}

.complete-button.is-complete {
  background: #eef2f6;
  color: var(--muted);
}

.hold-button,
.secondary-action-button {
  min-height: 34px;
  padding: 7px 10px;
  background: #eef2f6;
  color: #344054;
}

.hold-button.is-hold {
  background: #fff7d6;
  color: #8a5a00;
}

.task-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(92px, 1fr));
  gap: 6px;
  align-content: start;
  min-width: 230px;
}

.task-actions button,
.task-comment-form .secondary-action-button,
.action-placeholder {
  width: 100%;
  font-size: 0.8rem;
  line-height: 1.1;
  text-align: center;
}

.action-placeholder {
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 7px 10px;
  border-radius: 8px;
  background: #f4f6f9;
  color: var(--muted);
  font-weight: 800;
}

.task-times {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.82rem;
}

.task-comments {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.task-comments > strong {
  display: block;
}

.task-comment {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.task-comments .task-comment {
  margin-top: 0;
}

.empty-comments {
  color: var(--muted);
}

.task-comment strong,
.task-comment span {
  display: block;
}

.task-comment p {
  color: var(--text);
  margin: 4px 0;
}

.task-comment span {
  color: var(--muted);
  font-size: 0.82rem;
}

.task-comment-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(92px, 120px);
  align-items: start;
  gap: 8px;
  margin-top: 12px;
}

.task-comment-form .secondary-action-button {
  justify-self: stretch;
}

.task-comment-form.is-disabled {
  opacity: 0.72;
}

.task-comment-form textarea:disabled,
.task-comment-form button:disabled {
  cursor: not-allowed;
}

.task-comment-form button:disabled {
  background: #e4e7ec;
  color: var(--muted);
}

.report-comment + .report-comment {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.dividend-table {
  min-width: 980px;
}

.dividend-best td {
  background: #edf8f4;
}

.dividend-best td:first-child {
  box-shadow: inset 4px 0 0 var(--accent);
}

.stock-link {
  color: var(--accent-strong);
  text-decoration: none;
}

.stock-link:hover {
  text-decoration: underline;
}

.ipo-board {
  display: grid;
  gap: 16px;
  max-width: 1120px;
}

.ipo-hero {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  background: linear-gradient(135deg, #f7fbff 0%, #ffffff 52%, #edf8f4 100%);
}

.ipo-brand {
  display: inline-block;
  margin-bottom: 10px;
  color: #155da2;
  font-size: 1.6rem;
  font-style: italic;
  font-weight: 900;
}

.ipo-hero h2 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4rem);
  letter-spacing: 0;
}

.ipo-status {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 8px 12px;
  background: #e8f5ee;
  color: var(--accent-strong);
  font-weight: 900;
}

.ipo-metrics {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(220px, 0.6fr);
  gap: 14px;
}

.ipo-metric {
  display: grid;
  gap: 4px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff7e1;
  box-shadow: var(--shadow);
}

.ipo-metric.price-band {
  background: #b82032;
  color: #fff;
}

.ipo-metric span,
.ipo-metric small {
  font-weight: 800;
  opacity: 0.82;
}

.ipo-metric strong {
  font-size: clamp(1.45rem, 3vw, 2.4rem);
}

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

.ipo-category-card {
  padding: 16px;
  border-radius: 8px;
  background: #0f6090;
  color: #fff;
}

.ipo-category-card > span {
  display: block;
  margin-bottom: 12px;
  font-size: 1.3rem;
  font-weight: 900;
}

.ipo-category-card dl {
  display: grid;
  gap: 10px;
  margin: 0;
}

.ipo-category-card div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.ipo-category-card dt {
  color: rgba(255, 255, 255, 0.78);
}

.ipo-category-card dd {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 900;
  text-align: right;
}

.ipo-timeline {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.ipo-date-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.ipo-date-card span,
.ipo-date-card strong {
  display: block;
  text-align: center;
}

.ipo-date-card span {
  padding: 9px;
  font-size: 1.05rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ipo-date-card strong {
  padding: 14px 10px 16px;
  font-size: clamp(1.1rem, 2vw, 1.55rem);
}

.ipo-date-card.open span {
  background: #cfe7dd;
}

.ipo-date-card.close span {
  background: #d94b55;
  color: #fff;
}

.ipo-date-card.allotment span {
  background: #ffe2a8;
}

.ipo-date-card.listing span {
  background: #d6e5f2;
}

.ipo-contact {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  font-weight: 800;
}

.ipo-contact span {
  color: var(--muted);
}

.ipo-list {
  display: grid;
  gap: 12px;
}

.ipo-filter-grid {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(280px, 1fr) minmax(230px, 0.85fr) minmax(140px, auto);
  gap: 10px;
  align-items: center;
  margin-top: 16px;
}

.ipo-filter-grid .segmented {
  min-width: 0;
}

.ipo-filter-grid .primary-button {
  min-height: 46px;
  padding-inline: 16px;
  white-space: nowrap;
}

.inline-connect-button {
  display: inline-flex;
  width: auto;
  margin-top: 12px;
  padding: 9px 14px;
}

.ipo-table-wrap {
  background: #fff;
  overflow-x: visible;
}

.ipo-premium-table {
  min-width: 0;
  table-layout: fixed;
}

.ipo-premium-table th {
  white-space: nowrap;
  padding: 9px 7px;
  font-size: 0.68rem;
}

.ipo-premium-table td {
  padding: 9px 7px;
  font-size: 0.74rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.ipo-premium-table .secondary-action-button {
  min-width: 0;
  padding: 7px 8px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.ipo-company-link {
  color: var(--accent-strong);
  font-weight: 900;
  text-decoration: none;
}

.ipo-company-link:hover {
  text-decoration: underline;
}

.detail-body {
  background: #edf2f8;
}

.ipo-detail-page {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 40px;
}

.ipo-detail-hero,
.ipo-detail-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.ipo-detail-hero {
  overflow: hidden;
}

.ipo-detail-hero .brand {
  padding: 16px 18px;
  background: #0b2347;
  color: #fff;
}

.ipo-detail-hero .brand span {
  color: #d7e3f7;
}

.ipo-detail-hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px;
}

.ipo-detail-hero-content h1 {
  margin: 4px 0 8px;
  font-size: clamp(1.45rem, 3vw, 2.25rem);
}

.ipo-detail-hero-content p {
  max-width: 780px;
  color: var(--muted);
}

.ipo-detail-logo {
  width: 96px;
  height: 96px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.ipo-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.ipo-detail-card {
  padding: 18px;
}

.ipo-detail-card.wide {
  grid-column: 1 / -1;
}

.ipo-detail-card h2 {
  margin-bottom: 12px;
  color: #0b2347;
}

.ipo-detail-card p {
  color: #344054;
  line-height: 1.6;
}

.ipo-detail-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.ipo-detail-fact {
  padding: 12px;
  border-radius: 8px;
  background: #f3f6fb;
}

.ipo-detail-fact span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ipo-detail-fact strong {
  display: block;
  margin-top: 5px;
  color: #172033;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

  .ipo-current-price {
    display: inline-grid;
    gap: 3px;
    margin-bottom: 14px;
    padding: 12px 14px;
  border-radius: 8px;
  background: #fff4df;
  color: #0b2347;
}

.ipo-current-price span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ipo-current-price strong {
    font-size: 1.35rem;
  }

  .ipo-market-price-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 180px));
    gap: 10px;
    margin-bottom: 14px;
  }

  .ipo-market-price-grid .ipo-current-price {
    margin-bottom: 0;
  }

.ipo-detail-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.ipo-detail-table-wrap h3 {
  margin: 0 0 8px;
  color: #0b2347;
  font-size: 1rem;
}

.ipo-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.ipo-detail-table th,
.ipo-detail-table td {
  padding: 9px 10px;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.ipo-detail-table tr:first-child td,
.ipo-detail-table th {
  background: #e8f1ff;
  color: #0b2347;
  font-weight: 900;
}

.ipo-detail-table .ipo-summary-row td {
  background: #fff4df;
  color: #0b2347;
  font-weight: 900;
  text-align: center;
}

.ipo-subscription-grid {
  display: grid;
  gap: 14px;
}

.ipo-detail-links {
  display: grid;
  gap: 8px;
}

.ipo-detail-links a {
  display: block;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f3f6fb;
  color: var(--accent-strong);
  font-weight: 850;
  text-decoration: none;
}

.ipo-detail-links a:hover {
  background: #e8f1ff;
}

.pagination-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.pagination-controls button {
  width: auto;
  min-width: 96px;
}

.pagination-controls button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.ipo-list-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.ipo-list-main,
.ipo-list-facts {
  display: grid;
  gap: 12px;
}

.ipo-list-main {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
}

.ipo-list-main h3 {
  margin: 8px 0 4px;
  font-size: 1.25rem;
}

.ipo-list-main p {
  color: var(--muted);
  margin: 0;
  font-weight: 800;
}

.ipo-chip {
  display: inline-flex;
  width: max-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eaf1fb;
  color: var(--blue);
  font-size: 0.76rem;
  font-weight: 900;
}

.ipo-closing-today {
  display: inline-block;
  margin-top: 4px;
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 900;
}

.ipo-list-facts {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ipo-list-facts div,
.ipo-mini-cats span {
  padding: 10px;
  border-radius: 8px;
  background: #f4f6f9;
}

.ipo-list-facts span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.ipo-list-facts strong {
  display: block;
  margin-top: 4px;
}

.ipo-mini-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ipo-mini-cats span {
  font-size: 0.82rem;
  font-weight: 800;
}

.panel {
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 840px;
}

.form-head,
.wide {
  grid-column: 1 / -1;
}

.form-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.task-form-actions .primary-button {
  width: 100%;
}

.primary-button {
  min-height: 46px;
  padding: 12px 16px;
  background: var(--accent);
  color: #fff;
}

.primary-button:hover {
  background: var(--accent-strong);
}

.secondary-button {
  min-height: 42px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.1);
  color: #f5fbf8;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.18);
}

.danger-button {
  min-height: 34px;
  padding: 7px 10px;
  background: #fff1f0;
  color: var(--red);
}

.danger-button:hover {
  background: #ffe2df;
}

.report-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 0.7fr);
  gap: 18px;
  margin-bottom: 18px;
}

.report-filters {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  padding: 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f0f3f7;
  color: #344054;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.table-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 900;
  text-align: left;
  text-transform: inherit;
}

.table-sort-button::after {
  content: "↕";
  color: var(--muted);
  font-size: 0.78rem;
}

.table-sort-button.is-active::after {
  content: "↓";
  color: var(--accent-strong);
}

.table-sort-button.is-active.is-asc::after {
  content: "↑";
}

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

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fff;
}

.muted {
  color: var(--muted);
}

.user-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.user-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.user-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfe;
}

.user-row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.user-row strong,
.user-row span {
  display: block;
}

.user-row span {
  color: var(--muted);
  margin-top: 4px;
  font-size: 0.9rem;
}

.user-edit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.user-row .primary-button {
  justify-self: start;
  min-height: 40px;
}

.input[readonly] {
  background: #f3f5f8;
  color: var(--muted);
}

.admin-only.is-hidden {
  display: none;
}

@media (max-width: 900px) {
  html {
    scroll-padding-bottom: calc(var(--mobile-nav-height, 188px) + var(--mobile-keyboard-inset, 0px) + 88px);
  }

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

  .main {
    overflow: visible;
    padding-bottom: calc(var(--mobile-nav-height, 188px) + var(--mobile-keyboard-inset, 0px) + 24px);
  }

  .task-entry-view .sidebar {
    position: static;
  }

  .task-entry-view .stats-strip {
    display: none;
  }

  .task-form-actions {
    position: sticky;
    bottom: calc(var(--mobile-nav-height, 188px) + var(--mobile-keyboard-inset, 0px) + 8px);
    z-index: 5;
    padding: 10px 0;
    border-top: 1px solid var(--line);
    background: var(--surface);
  }

  .task-keyboard-open .tabs {
    display: none;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    min-height: auto;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    padding: 14px 18px;
    box-shadow: 0 10px 30px rgba(16, 36, 31, 0.22);
  }

  .sidebar .brand {
    grid-column: 1;
    padding-bottom: 0;
    border-bottom: 0;
  }

  .sidebar .field-label,
  .sidebar .role-card {
    display: none;
  }

  .signed-user {
    grid-column: 1;
    min-height: 38px;
    font-size: 0.92rem;
  }

  .secondary-button {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: center;
    min-width: 84px;
  }

  .tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: 4px;
    padding: 8px;
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    margin: 0;
    background: #10241f;
    box-shadow: 0 -12px 30px rgba(16, 36, 31, 0.24);
  }

  .tab {
    text-align: center;
    min-height: 48px;
    padding: 8px 6px;
    font-size: 0.82rem;
    display: grid;
    place-items: center;
  }

  .notification-tab {
    display: flex;
    justify-content: center;
  }

  .topbar,
  .toolbar {
    flex-direction: column;
    gap: 12px;
  }

  .task-controls {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .date-picker {
    width: 100%;
  }

  .date-today-button {
    min-height: 42px;
  }

  .segmented {
    grid-column: 1 / -1;
    width: 100%;
  }

  .stats-strip,
  .report-summary,
  .report-grid,
  .report-filters,
  .ipo-filter-grid,
  .ipo-detail-grid,
  .ipo-metrics,
  .ipo-category-grid,
  .ipo-timeline,
  .user-admin-grid,
  .user-edit-grid {
    grid-template-columns: 1fr;
  }

  .search {
    max-width: none;
  }

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

  @media (max-width: 620px) {
  body {
    background: #eef2f6;
  }

  .main,
  .sidebar {
    padding: 14px 18px;
  }

  .main {
    padding-bottom: calc(var(--mobile-nav-height, 188px) + var(--mobile-keyboard-inset, 0px) + 24px);
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }

  .brand strong {
    font-size: 0.98rem;
  }

  .brand span {
    font-size: 0.78rem;
  }

  h1 {
    font-size: 1.65rem;
  }

  .topbar {
    gap: 10px;
    margin-bottom: 12px;
  }

  .stats-strip {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 8px;
  }

  .stat {
    min-width: 0;
    padding: 10px;
  }

  .stat strong {
    font-size: 1.3rem;
  }

  .stat span {
    font-size: 0.76rem;
  }

  .tabs,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }

  .tab {
    border-radius: 8px;
    font-size: 0.75rem;
  }

  .segmented {
    order: 5;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: visible;
    min-width: 0;
    gap: 6px;
  }

  .segment {
    min-width: 0;
    min-height: 48px;
    padding: 8px 6px;
    white-space: normal;
    line-height: 1.15;
    font-size: 0.82rem;
  }

  .task-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .home-user-select {
    order: 1;
    grid-column: 1 / -1;
  }

  .home-date-from {
    order: 2;
  }

  .home-date-to {
    order: 3;
  }

  .date-today-button {
    order: 4;
    grid-column: 1 / -1;
    justify-self: start;
    min-width: 0;
    padding-inline: 16px;
  }

  .task-card {
    grid-template-columns: 1fr;
    padding: 15px;
    gap: 14px;
  }

  .new-task-notice {
    grid-template-columns: 1fr;
  }

  .task-actions {
    min-width: 0;
  }

  .complete-button,
  .hold-button,
  .secondary-action-button {
    min-height: 38px;
  }

  .task-comment-form {
    grid-template-columns: minmax(0, 1fr) minmax(88px, 112px);
  }

  .input {
    min-height: 46px;
  }

  .ipo-hero,
  .ipo-contact {
    flex-direction: column;
    align-items: stretch;
  }

  .ipo-list-main,
  .ipo-list-facts {
    grid-template-columns: 1fr;
  }

  .ipo-premium-table {
    min-width: 0;
    border-collapse: separate;
    border-spacing: 0 12px;
  }

  .ipo-table-wrap {
    overflow: visible;
    background: transparent;
    border: 0;
  }

  .ipo-premium-table thead {
    display: none;
  }

  .ipo-premium-table,
  .ipo-premium-table tbody,
  .ipo-premium-table tr,
  .ipo-premium-table td {
    display: block;
    width: 100%;
  }

  .ipo-premium-table tr {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  .ipo-premium-table td {
    display: grid;
    grid-template-columns: minmax(112px, 0.42fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 8px 0;
    border-bottom: 1px solid #edf1f5;
    text-align: right;
  }

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

  .ipo-premium-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-weight: 900;
    text-align: left;
  }

  .ipo-premium-table td:first-child {
    display: block;
    text-align: left;
  }

  .ipo-premium-table td:first-child::before {
    display: none;
  }

  .ipo-premium-table .secondary-action-button {
    justify-self: end;
  }

  .ipo-detail-hero-content {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .ipo-detail-logo {
    width: 78px;
    height: 78px;
  }

    .ipo-detail-facts {
      grid-template-columns: 1fr;
    }

    .ipo-market-price-grid {
      grid-template-columns: 1fr;
    }

    .pagination-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .pagination-controls span {
    order: -1;
    width: 100%;
  }

  .ipo-status {
    justify-self: start;
    width: max-content;
  }

  .ipo-category-card div {
    align-items: flex-start;
  }

  .primary-button,
  .secondary-button,
  .danger-button {
    min-height: 46px;
  }

  .user-row-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .user-row .primary-button,
  .danger-button {
    width: 100%;
  }
}
