/* Application styles on top of Bulma. Keep this small: prefer Bulma classes
   in the templates. No inline styles anywhere; the CSP forbids them. */

/* htmx request indicator (htmx's own injected styles are disabled for the CSP). */
.htmx-indicator { opacity: 0; transition: opacity 150ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }

/* Toast messages, bottom right. */
#toasts {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 100;
  display: flex; flex-direction: column; gap: 0.5rem;
  max-width: min(28rem, calc(100vw - 2rem));
}
#toasts .notification { margin: 0; box-shadow: 0 0.5em 1em -0.125em rgba(10, 10, 10, 0.2); }

/* Keep text clear of the dismiss button. */
.notification:has(> .delete) { padding-right: 3rem; }

/* The navbar burger is a <button> for keyboard access. */
button.navbar-burger { border: 0; background: transparent; }

/* Sticky footer on short pages. */
body { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }

/* Long unbroken values (addresses, names a device made up) wrap inside their cell. */
.wrap-anywhere { overflow-wrap: anywhere; }
.nowrap { white-space: nowrap; }

/* Numbers in tables line up. */
td.has-text-right, .tile-count { font-variant-numeric: tabular-nums; }

/* A row of numbers, each with its label. */
.tiles { display: flex; flex-wrap: wrap; gap: 0.75rem 2rem; }
.tile-number { display: flex; flex-direction: column; min-width: 5rem; }
.tile-count { font-size: 1.6rem; font-weight: 600; line-height: 1.2; }
.tile-label { font-size: 0.8rem; }

/* Name and value. */
.facts th { width: 11rem; font-weight: 500; white-space: nowrap; }
.facts td, .facts th { border: 0; padding-left: 0; }

/* A status tag next to a heading sits on the heading's line. */
.title .tag { vertical-align: middle; font-weight: 400; }

/* The traffic of the last hour: two lines, no axes. */
.spark { display: block; width: 100%; height: 4rem; border-bottom: 1px solid var(--bulma-border, #dbdbdb); }
.spark polyline { fill: none; stroke-width: 1.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.spark-in { stroke: var(--bulma-link, #485fc7); }
.spark-out { stroke: var(--bulma-success, #48c78e); }
.spark-key::before { content: ""; display: inline-block; width: 0.9rem; height: 2px; margin: 0 0.3rem 0.2rem 0.6rem; }
.spark-key-in::before { background: var(--bulma-link, #485fc7); }
.spark-key-out::before { background: var(--bulma-success, #48c78e); }

/* Ports by interface: the labels stay on one line where they can, the columns keep apart. */
.ports th, .ports td { vertical-align: top; }
.ports th { white-space: nowrap; }
.ports td .tag { white-space: normal; height: auto; min-height: 2em; }
/* A port on an address of another interface: reached here only if routed this way. */
.is-routed { opacity: 0.55; }

/* Rules: one rule a line, as the packet filter prints it. */
.rules code, .zone code { background: transparent; padding: 0; color: inherit; }
.rules tr.is-anchor td { border-top: 1px solid var(--bulma-border, #dbdbdb); }
pre.config { max-height: 34rem; overflow: auto; white-space: pre; }
pre.diff { white-space: pre-wrap; overflow-wrap: anywhere; padding: 0.75rem 1rem; }
.diff-add { color: var(--bulma-success-on-scheme, #1b7a3d); background: color-mix(in srgb, var(--bulma-success, #48c78e) 16%, transparent); }
.diff-del { color: var(--bulma-danger-on-scheme, #b3261e); background: color-mix(in srgb, var(--bulma-danger, #f14668) 16%, transparent); }
pre.diff span { display: block; }
.zones { display: grid; grid-template-columns: repeat(auto-fill, minmax(26rem, 1fr)); gap: 1.25rem 2rem; }
.zone .facts th { width: 8rem; }
tr.is-selected-row td { background: color-mix(in srgb, var(--bulma-info, #3e8ed0) 10%, transparent); }

/* What a zone's rules counted: a table inside its card. */
.counts td { border: 0; padding: 0.1rem 0.75rem 0.1rem 0; }

/* A firewall's rules as a list to work on. */
.rule-list td { vertical-align: top; }
.rule-list details summary { cursor: pointer; color: var(--bulma-link, #485fc7); }
.rule-list form.is-inline { display: inline-flex; gap: 0.25rem; }
