/* AXIS interface baseline — loaded last to keep every module readable and aligned. */
:root {
  --ui-font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", sans-serif;
  --ui-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Inter", "Segoe UI", sans-serif;
  --ui-control-height: 40px;
  --ui-radius: 8px;
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; }
body, button, input, select, textarea { font-family: var(--ui-font); }
body b, body strong, body h1, body h2, body h3, body h4, body h5, body h6 { font-family: var(--ui-font) !important; }
body { font-size: 14px; line-height: 1.48; letter-spacing: 0; }
button, input, select, textarea { font-size: 13px; line-height: 1.35; }
h1, h2, h3, h4, h5, h6 { margin-top: 0; font-family: var(--ui-display); line-height: 1.16; letter-spacing: -.02em; }
h1 { font-size: clamp(22px, 1.65vw, 28px); }
h2 { font-size: clamp(17px, 1.2vw, 21px); }
h3 { font-size: 15px; }
p { line-height: 1.55; }

/* Small text remains compact, but never microscopic. */
.eyebrow,
.section-label,
.panel-label,
.field-hint,
.meta-label,
.card-kicker,
.portal-action-kicker { font-size: 10px !important; line-height: 1.35 !important; letter-spacing: .13em !important; }
label { font-size: 11.5px; line-height: 1.35; }
small,
.muted,
.help,
.field-help,
.task-meta,
.document-meta,
.project-meta,
.client-meta { font-size: 10px; line-height: 1.45; }

/* Controls share one rhythm and readable focus state. */
input:not([type="checkbox"]):not([type="radio"]), select, textarea {
  min-height: var(--ui-control-height);
  padding: 10px 12px;
  border-radius: var(--ui-radius);
}
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { opacity: .7; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent, #9be83c);
  outline-offset: 2px;
}
.button, button.button, a.button, .btn, button:not(.icon-button):not(.menu-trigger):not(.modal-close) {
  min-height: 38px;
  padding: 9px 14px;
  border-radius: var(--ui-radius);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

/* Sidebar and brand hierarchy. */
.brand b { font-size: 16px; line-height: 1; letter-spacing: .2em; }
.brand small { font-size: 8.5px; line-height: 1.3; letter-spacing: .17em; }
.brand .brand-credit { font-size: 9px; line-height: 1.3; }
.sidebar nav > small { font-size: 9px; line-height: 1.4; letter-spacing: .13em; }
.sidebar nav > a { min-height: 40px; font-size: 12px; line-height: 1.25; gap: 11px; }
.sidebar nav > a > span { flex: 0 0 18px; text-align: center; }
.sidebar-search input { height: 40px; font-size: 12px; }
.sidebar-foot b { font-size: 11px; line-height: 1.25; }
.sidebar-foot small { font-size: 9px; line-height: 1.35; }
.nav-badge { font-size: 9px !important; }

/* Page headers and cards align without oversized empty areas. */
.topbar, .page-header, .section-header, .panel > header, .panel-header, .card-header {
  align-items: center;
  gap: 16px;
}
.topbar, .page-header { min-height: 0; }
.topbar h1, .page-header h1 { margin-bottom: 3px; }
.topbar p, .page-header p, .panel > header p { margin: 0; font-size: 11px; line-height: 1.45; }
.panel, .card, .metric-card { border-radius: 9px; }
.panel > header, .panel-header, .card-header { padding: 14px 16px; }
.panel > header > div, .panel-header > div, .card-header > div { min-width: 0; }

/* Repeated rows: content left, actions right, no glued-together labels. */
.log-body footer,
.log-actions,
.document-actions,
.task-actions,
.card-actions,
.row-actions,
.header-actions,
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.log-body footer { margin-top: 12px; padding-top: 10px; column-gap: 14px; row-gap: 7px; }
.log-body footer > *, .log-actions > * { margin: 0 !important; }
.log-body footer a, .log-body footer button, .log-actions a, .log-actions button {
  font-size: 10px !important;
  line-height: 1.3;
}
.log-entry-v2 { min-height: 82px; }
.log-entry-v2 .log-body { padding: 14px 16px; }
.log-entry-v2 h3 { margin: 4px 0 5px; font-size: 14px !important; line-height: 1.25; }
.log-entry-v2 p { margin: 0; font-size: 11px !important; line-height: 1.5; }
.log-entry-v2 time, .log-entry-v2 .category, .log-entry-v2 .visibility { font-size: 9.5px !important; line-height: 1.35; }

/* Lists, boards and document rows. */
.task-card h3, .task-card b, .document-row b, .project-card h3, .client-card h3 { font-size: 12px; line-height: 1.3; }
.task-card small, .document-row small, .project-card small, .client-card small { font-size: 9.5px !important; line-height: 1.4; }
.status-badge, .priority, .visibility, .doc-type, .tag, .chip, .badge { font-size: 9px !important; line-height: 1.25; letter-spacing: .04em; }
.project-gauge>strong,.project-card-progress strong,.portal-progress strong{font-family:var(--ui-font)!important;font-style:normal!important;font-weight:700!important;letter-spacing:-.02em!important}
.project-inline-status{margin:0}.project-inline-status label{display:block}.project-inline-status select{width:auto;min-width:96px;height:32px;padding:5px 30px 5px 11px;border:1px solid var(--line-hi);border-radius:5px;color:var(--text);background-color:var(--surface3);font-family:var(--ui-font)!important;font-size:10px!important;font-weight:700;line-height:1;letter-spacing:.06em;text-transform:uppercase;cursor:pointer}.project-inline-status select:hover,.project-inline-status select:focus{border-color:#747c84;box-shadow:0 0 0 2px rgba(255,255,255,.04)}.project-inline-status select:disabled{opacity:.65;cursor:wait}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.empty-state { line-height: 1.55; }
.empty-state h2, .empty-state h3 { margin-bottom: 6px; }
.empty-state p { font-size: 11px; }

/* Dialogs and settings retain a clear reading width. */
dialog, .modal-card, .axis-modal__panel { border-radius: 12px; }
.modal-card > header, .axis-modal__header { gap: 16px; padding: 16px 18px; }
.modal-card > section, .modal-card > form, .axis-modal__body { padding: 18px; }
.settings-nav a { min-height: 42px; font-size: 12px; }
.settings-panel h2 { font-size: 19px; }
.project-radar-timer{margin:0 0 20px;padding:0 0 18px;border-bottom:1px solid var(--line)}.project-radar-timer .button{width:100%;justify-content:center}.project-radar-running{display:flex;align-items:center;gap:9px;margin:0 0 20px;padding:11px 12px;border:1px solid var(--line-hi);border-radius:7px;color:var(--text);background:var(--surface2)}.project-radar-running i{width:7px;height:7px;border-radius:50%;background:var(--accent);box-shadow:0 0 9px var(--accent)}.project-radar-running span{flex:1;font-size:10px}.project-radar-running b{font-size:12px;font-variant-numeric:tabular-nums}

/* Customer portal uses the same typographic system as the backend. */
.portal-body { font-size: 14px; }
.portal-header { min-height: 64px; }
.portal-shell { line-height: 1.5; }
.portal-card header h2 { font-size: 16px; }
.portal-card header p, .portal-empty { font-size: 11px; line-height: 1.5; }
.portal-metrics strong { font-size: 20px; }
.portal-metrics span { font-size: 10px; }
.portal-task b, .portal-update b, .portal-item b, .portal-file b { font-size: 12px; line-height: 1.35; }
.portal-task small, .portal-update time, .portal-item time, .portal-file small, .portal-subtask { font-size: 9.5px !important; line-height: 1.45 !important; }
.portal-message p { font-size: 11.5px; line-height: 1.55; }
.portal-message time { font-size: 9px; }
.portal-auth section p { font-size: 12px; line-height: 1.55; }

/* Login and installation should not fall back to the old tiny scale. */
.login-panel label, .setup-form label { font-size: 11.5px; }
.login-panel form > p, .setup-intro p { font-size: 12px; }
.setup-form legend { font-size: 14px; }
.checks div { font-size: 11px; }

@media (max-width: 900px) {
  body { font-size: 13px; }
  .topbar, .page-header, .section-header { align-items: flex-start; flex-wrap: wrap; }
  .header-actions, .hero-actions { width: 100%; justify-content: flex-start; }
  .panel > header, .panel-header, .card-header { padding: 12px 14px; }
  .portal-header { padding-inline: 16px; }
}

@media (max-width: 600px) {
  h1 { font-size: 21px; }
  h2 { font-size: 17px; }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { font-size: 16px; }
  .button, button.button, a.button, .btn { min-height: 42px; }
  .log-body footer, .log-actions { gap: 8px 12px; }
}

/* Dashboard project rows behave like the navigation elements they are. */
.project-list > .dashboard-project-link {
  display: flex;
  min-height: 54px;
  align-items: center;
  gap: 12px;
  padding: 12px 6px;
  border-bottom: 1px solid var(--line);
  border-radius: 5px;
  color: var(--text);
  text-decoration: none;
  transition: background-color .16s ease, border-color .16s ease, transform .16s ease;
}
.project-list > .dashboard-project-link:hover,
.project-list > .dashboard-project-link:focus-visible {
  border-color: var(--line-hi);
  background: var(--surface3);
  transform: translateX(2px);
}
.dashboard-project-link section { display: flex; min-width: 0; flex: 1; flex-direction: column; }
.dashboard-project-link section b,
.dashboard-project-link section small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-project-arrow { color: var(--muted); font-size: 14px; font-style: normal; transition: transform .16s ease; }
.dashboard-project-link:hover .dashboard-project-arrow { transform: translateX(3px); }
@media (max-width: 600px) {
  .dashboard-project-link .progress { display: none; }
}
