/* Shared building blocks: icons, headings, tabs, buttons, forms, dialogs, states and notes. */
/* Radzen adds its icon font only after the app starts. Declaring it here with font-display: block keeps
   ligature names such as "directions_run" from flashing as text while the font loads. */
@font-face {
  font-family: "Material Symbols";
  src: url("../../Radzen.Blazor/fonts/MaterialSymbolsOutlined.woff2") format("woff2");
  font-style: normal; font-weight: 100 700; font-display: block;
}
.rzi {
  display: inline-block; overflow: hidden; width: 1em; font-family: "Material Symbols"; font-style: normal; font-weight: 400;
  line-height: 1; letter-spacing: normal; text-transform: none; white-space: nowrap; word-wrap: normal; direction: ltr;
  font-feature-settings: "liga"; -webkit-font-smoothing: antialiased;
}
.v-heading { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 26px; }
/* Area sub-navigation below the heading: one row on wide screens; on phones every tab stays visible by wrapping evenly. */
.v-tabs {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  margin: -8px 0 22px; padding: 4px; border: 1px solid var(--v-border); border-radius: 12px; background: var(--v-bg);
}
.v-tabs a {
  display: grid; place-items: center; min-height: 44px; padding: 6px 12px; border: 1px solid transparent;
  border-radius: 8px; text-decoration: none; color: var(--v-text); font-size: .85rem; text-align: center;
}
.v-tabs a:hover { border-color: var(--v-border); }
.v-tabs a.active { background: var(--v-accent); color: var(--v-accent-ink); font-weight: 650; }
@media (max-width: 600px) {
  .v-tabs { grid-auto-flow: row; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); }
  .v-tabs a { padding: 6px 8px; font-size: .8rem; }
}
.v-heading h1 { margin-bottom: 6px; }
.v-heading p { margin-bottom: 0; color: var(--v-muted); }
.v-primary, .v-button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 14px;
  border: 1px solid var(--v-border); border-radius: 9px; background: var(--v-surface); color: var(--v-text);
  text-decoration: none; font: inherit; cursor: pointer; line-height: 1.25;
}
.v-primary { background: var(--v-accent); color: var(--v-accent-ink); border-color: var(--v-accent); font-weight: 640; }
.v-button:hover { border-color: var(--v-accent); }
.v-button.danger { color: var(--v-text); border-color: var(--v-danger); }
.habit-page button:disabled, .v-dialog button:disabled { opacity: .42; cursor: default; }
.v-controls, .v-actions, .habit-date-nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.v-controls { margin-bottom: 26px; }
.v-primary .rzi, .v-button .rzi { font-size: 20px; }
@media (max-width: 600px) {
  /* Date navigation gets its own row; category and archive share the next one. */
  .v-controls { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .v-controls > .habit-date-nav { grid-column: 1 / -1; }
}
.v-controls label, .v-form label { display: grid; gap: 5px; color: var(--v-muted); font-size: .84rem; }
.v-controls select, .habit-group-header select, .v-dialog select, .v-dialog input, .v-dialog textarea {
  min-height: 44px; padding: 8px 12px; border: 1px solid var(--v-border); border-radius: 9px;
  background: var(--v-bg); color: var(--v-text); font: inherit; width: 100%;
}
.v-overlay {
  position: fixed; inset: 0; z-index: 110; display: grid; grid-template: minmax(0, 1fr) / minmax(0, 1fr); place-items: center;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
    max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  background: var(--v-overlay);
}
.v-dialog {
  width: min(100%, 520px); min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior-y: contain; padding: 20px;
  background: var(--v-surface); border: 1px solid var(--v-border); border-radius: 16px; box-shadow: 0 20px 80px var(--v-shadow);
}
.v-dialog-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 12px; }
.v-dialog-title h2 { margin: 0; overflow-wrap: anywhere; }
.v-dialog textarea { resize: vertical; }
.v-form, .v-form fieldset { display: grid; gap: 10px; min-width: 0; }
.v-form fieldset { margin: 0; padding: 0; border: 0; }
.v-actions { margin-top: 10px; }
.v-actions p { flex-basis: 100%; margin: 0; }
.v-error { color: var(--v-danger); }
/* Shared loading, empty and error states (P1-06). Text always names the state; colour and motion only support it. */
.v-state { display: flex; align-items: flex-start; gap: var(--v-space-3); margin: var(--v-space-3) 0; color: var(--v-muted); font-size: .9rem; }
.v-state-body { min-width: 0; flex: 1; }
.v-state-body > :last-child { margin-bottom: 0; }
.v-state-loading { align-items: center; }
.v-spinner { flex: none; width: 16px; height: 16px; border: 2px solid color-mix(in srgb, var(--v-accent) 25%, transparent); border-top-color: var(--v-accent); border-radius: 50%; animation: v-spin .9s linear infinite; }
@keyframes v-spin { to { transform: rotate(360deg); } }
.v-state-empty { padding: var(--v-space-4) var(--v-space-5); border: 1px dashed var(--v-border); border-radius: var(--v-radius-md); background: color-mix(in srgb, var(--v-surface) 70%, transparent); }
.v-state-icon { flex: none; color: var(--v-accent); }
.v-state-icon .rzi { font-size: 28px; }
.v-state-title { margin-bottom: var(--v-space-2); color: var(--v-text); font-size: 1.15rem; }
.v-state-error { align-items: center; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--v-danger); border-left-width: 4px; border-radius: var(--v-radius-sm); background: color-mix(in srgb, var(--v-danger) 10%, transparent); color: var(--v-text); }
@media (prefers-reduced-motion: reduce) { .v-spinner { animation: none; border-color: var(--v-accent); } }
.v-switch { display: flex; flex-wrap: wrap; gap: 6px; }
.v-switch [aria-pressed="true"] { border-color: var(--v-accent); color: var(--v-accent); }
@media (max-width: 600px) {
  .v-heading { flex-wrap: wrap; align-items: flex-start; }
  .v-dialog { padding: 16px; }
}
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
/* Calculation notes stay available but collapsed. */
.v-info { margin-top: 12px; color: var(--v-muted); font-size: .8rem; }
.v-info > summary { cursor: pointer; width: fit-content; color: var(--v-text); font-size: .82rem; }
.v-info > :not(summary) { margin: 8px 0 0; }
.v-info ul { padding-left: 18px; }
