* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a, input, select, textarea, summary { -webkit-tap-highlight-color: transparent; }
a { color: var(--primary); text-underline-offset: 3px; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .48; }
button, input, select, textarea { max-width: 100%; }
:focus-visible { outline: var(--focus-width) solid var(--focus-dark); outline-offset: var(--focus-offset); box-shadow: 0 0 0 calc(var(--focus-offset) + var(--focus-width) + 2px) var(--focus-light); }
.theme-root { background: var(--bg); color: var(--text); font-family: var(--font); font-size: var(--text-body); line-height: var(--line-height); min-height: 100vh; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: var(--text-xl); line-height: 1.35; letter-spacing: -.035em; font-weight: 650; }
h2 { font-size: var(--text-md); line-height: 1.5; font-weight: 650; }
h3 { font-size: var(--text-body); font-weight: 650; }
small { font-size: var(--text-xs); color: var(--muted); }
code { font-family: var(--mono); font-size: var(--text-xs); }
svg { flex-shrink: 0; vertical-align: middle; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; clip: rect(0,0,0,0); overflow: hidden; white-space: nowrap; border: 0; }
.skip-link { position: fixed; top: -80px; left: var(--s4); background: var(--surface); padding: var(--s3) var(--s4); z-index: var(--z-modal); }
.skip-link:focus { top: var(--s4); }
.app-header { min-height: var(--header-height); background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: var(--s4); padding: var(--s4) var(--s8); }
.header-left, .header-right { display: flex; align-items: center; gap: var(--s4); font-size: var(--text-xs); }
.main-content { padding: var(--s8); max-width: 1760px; margin: auto; }
.page-header { position: relative; padding-top: var(--s3); border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; gap: var(--s6); margin-bottom: var(--s8); }
.eyebrow { font-size: var(--text-xs); color: var(--muted); font-weight: 600; letter-spacing: .16em; margin-bottom: var(--s2); }
.page-header p { margin-top: var(--s3); color: var(--muted); font-size: var(--text-sm); }
.page-actions { display: flex; align-items: center; gap: var(--s5); }
.button { min-height: var(--control-height); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: var(--s2) var(--s4); display: inline-flex; align-items: center; justify-content: center; gap: var(--s2); font-size: var(--text-sm); font-weight: 550; text-decoration: none; background: var(--surface); color: var(--text); transition: transform var(--duration) var(--ease); line-height: 1.5; }
.button-primary { color: var(--on-action); background: var(--primary); border-color: var(--primary); }
.button-primary:hover:not(:disabled) { background: var(--primary-hover); }
.button-secondary:hover:not(:disabled) { background: var(--soft); }
.button-ghost { border-color: transparent; background: transparent; color: var(--primary); }
.button-ghost:hover:not(:disabled) { background: var(--soft); }
.button-danger { background: var(--danger); color: var(--on-danger); border-color: var(--danger); }
.button-danger:hover:not(:disabled) { text-decoration: underline; }
.button:active:not(:disabled) { transform: translateY(1px); }
.icon-button { min-width: var(--control-height); padding: var(--s2); flex-shrink: 0; }
.badge { display: inline-flex; align-items: center; gap: var(--s1); white-space: nowrap; padding: 3px var(--s2); border-radius: var(--radius); font-size: var(--text-xs); font-weight: 550; line-height: 1.55; background: var(--soft); color: var(--muted); }
.tone-success { background: var(--success-bg); color: var(--success); }
.tone-warning { background: var(--warning-bg); color: var(--warning); }
.tone-danger { background: var(--danger-bg); color: var(--danger); }
.tone-info { background: var(--info-bg); color: var(--info); }
.tone-ai { background: var(--ai-soft); color: var(--ai); }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); min-width: 0; }
.content-section { min-width: 0; }
.card > .content-section { padding: calc(var(--s6) * var(--density)); }
.section-heading { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s5); }
.section-heading p { color: var(--muted); font-size: var(--text-xs); margin-top: var(--s1); }
.section-heading h2 { letter-spacing: -.01em; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--s3); margin-bottom: var(--s4); }
.table-scroll { overflow-x: auto; }
.table-hint { display: none; }
table { width: 100%; border-collapse: collapse; font-size: var(--text-xs); text-align: left; }
th, td { padding: var(--cell-padding) var(--s3); border-bottom: 1px solid var(--border); }
thead th { color: var(--muted); font-weight: 500; white-space: nowrap; background: var(--bg); padding-top: var(--s3); padding-bottom: var(--s3); }
tbody th { font-weight: 500; }
tbody tr:hover { background: var(--soft); }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.input { min-height: var(--control-height); width: 100%; background: var(--surface); color: var(--text); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: var(--s2) var(--s3); font-size: var(--text-xs); }
.input::placeholder { color: var(--muted); }
.input[aria-invalid="true"] { border-width: 2px; border-color: var(--danger-text); }
.input:disabled { opacity: .5; cursor: not-allowed; }
.textarea { resize: vertical; min-height: 90px; }
.select { width: auto; min-width: 100px; }
.form-field { display: flex; flex-direction: column; gap: var(--s2); min-width: 0; }
.form-field > label { font-size: var(--text-xs); font-weight: 600; }
.form-field .select { width: 100%; }
.form-field small { font-size: var(--text-xs); }
.field-error { color: var(--danger-text); display: flex; align-items: center; gap: var(--s1); }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: var(--text-xs); }
.alert { border-radius: var(--radius); display: flex; align-items: flex-start; gap: var(--s3); padding: var(--s4); font-size: var(--text-xs); line-height: 1.6; }
.alert > svg { margin-top: 1px; }
.alert strong { display: block; font-weight: 600; }
.alert p { margin-top: var(--s1); }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: var(--s3); text-align: center; padding: var(--s8) var(--s4); color: var(--muted); }
.empty-state strong { color: var(--text); font-size: var(--text-sm); }
.empty-state p { font-size: var(--text-xs); }
.error-state { display: grid; gap: var(--s3); }
.stack { display: grid; gap: var(--s3); }
.flex-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.muted { color: var(--muted); }
.company-logo { display: inline-flex; align-items: center; justify-content: center; padding: 10px 12px; background: var(--logo-surface); border-radius: var(--radius); }
.company-logo img { width: 100%; height: auto; display: block; object-fit: contain; }
.header-logo { width: 236px; flex-shrink: 0; }
.compact-brand { display: none; font-weight: 700; letter-spacing: .04em; }
.page-header::before { content: ''; position: absolute; width: 40px; height: 2px; top: -1px; left: 0; background: var(--accent); transform: skewX(-24deg); }
@media (max-width: 960px) {
.main-content { padding: var(--s6); }
.app-header { padding: var(--s3) var(--s6); }
.page-header { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 640px) {
.main-content { padding: var(--s5) var(--s4); }
.app-header { padding: var(--s2) var(--s4); }
.header-left { gap: var(--s2); }
.header-logo, .header-slash { display: none; }
.compact-brand { display: inline; }
.header-right { gap: var(--s2); }
.page-header { margin-bottom: var(--s6); gap: var(--s4); }
.page-header h1 { font-size: var(--text-lg); }
.page-actions { justify-content: space-between; width: 100%; gap: var(--s3); }
.card > .content-section { padding: var(--s4); }
.table-hint { display: block; color: var(--muted); font-size: var(--text-xs); margin-top: var(--s2); }
.page-footer { flex-direction: column; }
.form-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
*, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
:focus-visible { outline: 3px solid Highlight; }
}
