.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: block;
  flex: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: var(--text);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
}

.btn-sm {
  min-height: 44px;
  padding: 8px 14px;
  font-size: 14px;
}

.btn-block {
  width: 100%;
}

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

.btn-primary:hover {
  background: var(--button-hover);
  color: var(--on-button);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  color: var(--primary-hover);
}

.btn-ghost:hover {
  background: var(--surface-soft);
  color: var(--button-hover);
}

.btn-danger {
  background: var(--danger);
  color: var(--on-button);
}

.btn-danger:hover {
  background: #A33B3B;
  color: var(--on-button);
}

.btn:disabled {
  background: #D5E3DA;
  border-color: transparent;
  color: #4E6156;
  cursor: not-allowed;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-link {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: inherit;
  text-decoration: none;
  height: 100%;
  transition: transform 160ms ease;
}

.card-link:hover {
  color: inherit;
  transform: translateY(-2px);
}

.card h3,
.record h3 {
  font-size: 20px;
  line-height: 1.3;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--primary-hover);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
}

.badge-neutral {
  background: #EEF3F0;
  color: var(--charcoal);
}

.badge-mint {
  background: var(--mint);
  color: var(--text);
}

.badge-success {
  background: var(--surface-soft);
  color: var(--button-hover);
}

.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-text);
}

.badge-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.alert {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.alert p + p {
  margin-top: 4px;
}

.alert-info {
  background: var(--surface-soft);
  border-color: var(--mint);
}

.alert-success {
  background: #E7F6EC;
  border-color: var(--mint);
}

.alert-warning {
  background: var(--warning-bg);
  border-color: #E6D3AE;
  color: var(--warning-text);
}

.alert-danger {
  background: var(--danger-bg);
  border-color: #F0C8C8;
}

.field {
  display: grid;
  gap: 8px;
}

.field-label {
  font-weight: 600;
  font-size: 14px;
}

.req {
  color: var(--danger);
}

.field-control {
  position: relative;
}

.input,
select.input,
textarea.input {
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

textarea.input {
  min-height: 128px;
  resize: vertical;
}

.field.has-error .input {
  border-color: var(--danger);
}

.field-hint,
.field-error {
  font-size: 14px;
  line-height: 1.45;
}

.field-hint {
  color: var(--text-secondary);
}

.field-error {
  color: var(--danger);
  font-weight: 500;
}

.password-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  min-height: 36px;
  padding: 8px 12px;
  border: 0;
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--primary-hover);
  font-weight: 600;
  font-size: 14px;
}

.field-control .input {
  padding-right: 108px;
}

.check {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 15px;
}

.check input {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  accent-color: var(--button);
  flex: none;
}

.choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.choice {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
}

.form {
  display: grid;
  gap: 16px;
}

.inline-form {
  display: inline-grid;
}

fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
}

progress {
  width: 100%;
  height: 8px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: #E5F0E9;
}

progress::-webkit-progress-bar {
  background: #E5F0E9;
}

progress::-webkit-progress-value {
  background: var(--primary);
}

progress::-moz-progress-bar {
  background: var(--primary);
}

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

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.record-list,
.stack {
  display: grid;
  gap: 16px;
}

.record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

.record .meta,
.quiet {
  color: var(--text-secondary);
  font-size: 14px;
}

.record-actions,
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

.table-note {
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 14px;
}

.data-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 12px 16px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.data-table th {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  background: #F3FAF5;
}

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

.empty {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 32px 24px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-mark {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background: var(--surface-soft);
  color: var(--primary-hover);
}

.empty h2,
.empty h3 {
  font-size: 22px;
  line-height: 1.3;
}

.skeleton-block {
  display: grid;
  gap: 12px;
}

.skeleton {
  display: block;
  height: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #E7F2EB 0%, #F7FBF8 50%, #E7F2EB 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}

.skeleton-title {
  height: 28px;
  width: min(280px, 70%);
}

.skeleton-card {
  height: 96px;
  border-radius: var(--radius-lg);
}

@keyframes shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

.modal[hidden] {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 16px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(32, 53, 44, 0.46);
}

.modal-dialog {
  position: relative;
  width: min(560px, 100%);
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}

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

.modal-head h2 {
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
}

.toast-region {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100% - 32px));
}

.toast {
  padding: 16px;
  border-radius: var(--radius);
  background: var(--charcoal);
  color: #F7FBF8;
  box-shadow: var(--shadow-lg);
}

.faq-item {
  border-top: 1px solid var(--border);
}

.faq-item summary {
  min-height: 56px;
  padding: 16px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  float: right;
  color: var(--primary-hover);
  font-weight: 600;
}

.faq-item[open] summary::after {
  content: "–";
}

.faq-item p {
  padding-bottom: 16px;
  color: var(--text-secondary);
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--text-secondary);
  font-size: 14px;
}

.crumbs a {
  color: var(--text-secondary);
  text-decoration: none;
}

.crumbs a:hover {
  color: var(--primary-hover);
}

.seg {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.seg a {
  min-height: 36px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
}

.seg a[aria-current="true"] {
  background: var(--button);
  color: var(--on-button);
}

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

.stat {
  padding: 16px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--border);
}

.stat span {
  display: block;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.stat strong {
  display: block;
  margin-top: 8px;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.notice-wrap {
  padding-top: 16px;
}

.stack-tight {
  display: grid;
  gap: 8px;
}

.stat em {
  font-style: normal;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
}
