:root {
    --bg: #f3f4f6;
    --surface: #ffffff;
    --field: #f1f2f5; /* inputs and quiet buttons inside panels */
    --hover: #e7e9ee;
    --text: #1d2129;
    --muted: #6b7280;
    --border: #dde0e6;
    --accent: #2563eb;
    --accent-soft: #2563eb22;
    --danger: #dc2626;
    --ok: #16a34a;
    --stage: #e2e5ea;
    --shadow: 0 8px 28px rgb(15 23 42 / 18%);
    color-scheme: light;
}

[data-theme="dark"] {
    --bg: #131519;
    --surface: #1c1f26;
    --field: #262a33;
    --hover: #2f343f;
    --text: #e6e8eb;
    --muted: #949cab;
    --border: #313743;
    --accent: #5b93ff;
    --accent-soft: #5b93ff30;
    --danger: #f87171;
    --ok: #4ade80;
    --stage: #0b0c0f;
    --shadow: 0 8px 28px rgb(0 0 0 / 55%);
    color-scheme: dark;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font: 14px/1.4 system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
}

a {
    color: var(--accent);
}

h1 {
    margin: 20px 0 14px;
    font-size: 22px;
}

h2 {
    margin: 24px 0 10px;
    font-size: 16px;
}

.muted {
    color: var(--muted);
}

.lead {
    margin: -8px 0 20px;
}

small {
    font-size: 12px;
}

code {
    padding: 2px 6px;
    border-radius: 5px;
    background: var(--field);
    font-size: 12px;
    overflow-wrap: anywhere;
}

/* What went wrong with the last request. */
.alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--danger);
    border-radius: 8px;
    background: color-mix(in srgb, var(--danger) 10%, transparent);
    color: var(--danger);
}

.alert.ok {
    border-color: var(--ok);
    background: color-mix(in srgb, var(--ok) 10%, transparent);
    color: var(--ok);
}

/* A number that belongs to a heading: how many there are. */
.count {
    margin-left: 4px;
    padding: 1px 8px;
    border-radius: 10px;
    background: var(--hover);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

/* An icon on a tinted square: what kind of thing a card or a tile is about. */
.badge-icon {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
}

/* An icon of the library: an outline in the color of the text around it. */
.icon {
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Controls --- */

input,
select,
button,
.button {
    font: inherit;
    color: inherit;
    height: 32px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background-color: var(--surface);
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

select {
    appearance: none;
    padding-right: 28px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238a93a3' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 8px center;
}

input[type="checkbox"] {
    width: 16px;
    height: 16px;
    padding: 0;
    accent-color: var(--accent);
}

input[type="color"] {
    padding: 1px 2px;
    width: 44px;
}

button,
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

button:hover,
.button:hover {
    border-color: var(--accent);
}

button:disabled {
    opacity: 0.35;
    cursor: default;
    border-color: var(--border);
}

.primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
}

.primary:hover {
    filter: brightness(1.1);
}

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

/* A button that is only its icon; one that switches something on and off shows which. */
.tool {
    width: 32px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: inherit;
}

.tool:hover {
    border-color: transparent;
    background: var(--hover);
}

.tool:disabled {
    border-color: transparent;
    background: transparent;
}

[aria-pressed="true"] {
    background: var(--accent-soft);
    color: var(--accent);
}

.swatches {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 3px 2px;
}

.swatch {
    width: 24px;
    height: 24px;
    padding: 0;
    border-radius: 50%;
    box-shadow: inset 0 0 0 1px rgb(128 128 128 / 50%);
}

.swatch.current {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* The frame around an input and what belongs to it: a short name in front, a unit or the
   button of a combo box behind. */
.control {
    display: flex;
    align-items: center;
    height: 30px;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--field);
}

.control:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-soft);
}

.control input {
    flex: 1;
    width: 100%;
    min-width: 0;
    height: 100%;
    padding: 0 0 0 8px;
    border: 0;
    outline: 0;
    background: none;
    appearance: textfield; /* no spin buttons: arrow keys still count up and down */
}

.control input::-webkit-inner-spin-button {
    display: none;
}

.control input[type="color"] {
    flex: none;
    width: 28px;
    height: 22px;
    margin-left: 4px;
    padding: 0;
}

.affix {
    padding-left: 8px;
    font-size: 11px;
    color: var(--muted);
    white-space: nowrap;
}

input + .affix {
    padding: 0 6px 0 2px;
}

.combo-toggle {
    flex: none;
    width: 22px;
    height: 100%;
    padding: 0;
    border: 0;
    border-radius: 0 6px 6px 0;
    background: none;
    color: var(--muted);
}

.combo-toggle:hover {
    background: var(--hover);
    color: var(--text);
}

/* Buttons of which one is chosen. */
.segment {
    display: flex;
    gap: 2px;
    height: 30px;
    padding: 2px;
    border: 1px solid var(--border);
    border-radius: 7px;
    background: var(--field);
}

.segment button {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0 4px;
    border: 0;
    border-radius: 5px;
    background: none;
    font-size: 12px;
}

.segment button:hover {
    background: var(--hover);
}

.segment [aria-pressed="true"],
.segment [aria-pressed="true"]:hover {
    background: var(--surface);
    box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
}

/* What drops down from a combo box, and the menu of the right mouse button. */
.menu {
    position: fixed;
    z-index: 50;
    display: grid;
    min-width: 150px;
    max-height: min(440px, 90vh);
    overflow: auto;
    padding: 4px;
    border: 1px solid var(--border);
    border-radius: 9px;
    background: var(--surface);
    box-shadow: var(--shadow);
    font-size: 13px;
}

.menu button {
    justify-content: start;
    height: 28px;
    padding: 0 10px 0 8px;
    border: 0;
    background: none;
}

.menu button:hover:enabled,
.menu button:focus-visible {
    background: var(--hover);
    outline: 0;
}

.menu .current {
    color: var(--accent);
    font-weight: 600;
}

.menu hr {
    width: 100%;
    margin: 4px 0;
    border: 0;
    border-top: 1px solid var(--border);
}

.menu-key {
    margin-left: auto;
    padding-left: 20px;
    font-size: 11px;
    color: var(--muted);
}

/* --- Layout --- */

.topbar {
    display: flex;
    align-items: center;
    gap: 16px;
    height: 46px;
    padding: 0 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.topbar nav {
    display: flex;
    gap: 4px;
    flex: 1;
}

.topbar a {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text);
    text-decoration: none;
}

.topbar nav a {
    height: 32px;
    padding: 0 10px;
    border-radius: 7px;
    color: var(--muted);
}

.topbar nav a:hover {
    background: var(--hover);
    color: var(--text);
}

.topbar nav .current {
    background: var(--accent-soft);
    color: var(--accent);
}

.brand {
    font-weight: 700;
}

.topbar .account {
    color: var(--muted);
}

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

/* Whose project or provider it is, where the admin looks at those of others. */
.owner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.brand .icon {
    color: var(--accent);
}

.page {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 8px 16px 32px;
}

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px;
    margin-bottom: 16px;
}

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

/* The kinds of providers to choose from: a click opens the form of one. */
.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px;
}

.type-tile {
    justify-content: start;
    gap: 12px;
    height: auto;
    padding: 12px;
    border-radius: 10px;
    text-align: left;
    white-space: normal;
}

.type-tile > span:nth-child(2) {
    flex: 1;
}

.type-tile strong,
.type-tile small {
    display: block;
}

.type-tile > .icon {
    color: var(--muted);
}

.type-tile:hover {
    box-shadow: 0 2px 10px rgb(0 0 0 / 12%);
}

.type-tile:hover > .icon {
    color: var(--accent);
}

.provider {
    padding: 0;
}

.provider > * {
    padding: 12px 16px;
}

.provider > * + * {
    border-top: 1px solid var(--border);
}

.provider-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.provider-title {
    flex: 1;
    min-width: 0;
}

/* State of a provider: a colored dot, then "connected" or the error. */
.status {
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.status::before {
    content: "●";
    margin-right: 6px;
}

.status.ok {
    background: color-mix(in srgb, var(--ok) 14%, transparent);
    color: var(--ok);
}

.status.fail {
    background: color-mix(in srgb, var(--danger) 12%, transparent);
    color: var(--danger);
}

.connect {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

/* A part that folds: an arrow that turns, then what it is. */
.fold > summary {
    display: flex;
    align-items: center;
    gap: 6px;
    list-style: none;
    font-weight: 600;
    user-select: none;
}

.fold > summary::-webkit-details-marker {
    display: none;
}

.fold > summary .icon {
    color: var(--muted);
}

.fold[open] > summary .icon {
    transform: rotate(90deg);
}

.fold[open] > summary {
    margin-bottom: 8px;
}

.values td:first-child {
    width: 32%;
}

.values td:nth-child(2) {
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.values small {
    display: block;
    overflow-wrap: anywhere;
}

.values tr:hover td {
    background: var(--field);
}

.empty {
    display: grid;
    justify-items: center;
    gap: 4px;
    padding: 28px;
    color: var(--muted);
}

.empty p {
    margin: 0;
}

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

.form-row label {
    display: grid;
    gap: 4px;
}

.form-row .grow {
    flex: 1;
    min-width: 220px;
}

.form-row input[type="number"] {
    width: 110px;
}

/* Cards side by side, e.g. one "new provider" form per type. */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    align-items: start;
    gap: 16px;
    margin-bottom: 16px;
}

.card-grid .card {
    margin-bottom: 0;
}

/* A project: what its display shows, below it name, size and what to do with it. */
.project-card {
    display: grid;
    gap: 10px;
    padding: 0 0 12px;
    overflow: hidden;
}

.project-card > :not(.thumb) {
    margin: 0 12px;
}

.thumb {
    display: grid;
    place-items: center;
    aspect-ratio: 16 / 10;
    padding: 14px;
    background: var(--stage);
    color: var(--muted);
}

.thumb img {
    max-width: 100%;
    max-height: 100%;
    min-height: 0;
    object-fit: contain;
    box-shadow: 0 2px 10px rgb(0 0 0 / 30%);
}

/* The icon stands in while there is no picture. */
.thumb img + .icon {
    display: none;
}

.project-name {
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
}

.project-card .actions {
    justify-content: start;
}

.project-card .actions form {
    margin-left: auto;
}

/* Form with one field per line. */
.form-stack {
    display: grid;
    gap: 10px;
}

/* Form with its fields in equal columns and the button on a line of its own. */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px 12px;
}

.provider > .form-grid {
    background: var(--bg);
    border-radius: 0 0 10px 10px;
}

.form-stack label,
.form-grid label {
    display: grid;
    gap: 4px;
}

.form-stack input,
.form-grid input {
    width: 100%;
}

.form-stack > button,
.form-grid > .actions {
    grid-column: 1 / -1;
    justify-self: start;
}

.form-dialog {
    width: min(440px, 94vw);
}

.narrow {
    max-width: 400px;
}

.narrow h2 {
    margin-top: 0;
}

.login {
    margin: 10vh auto 0;
}

.login h1 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0 0 6px;
}

.users td {
    vertical-align: middle;
}

.user-name,
.set-password {
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-dialog h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.list {
    width: 100%;
    border-collapse: collapse;
}

.list th,
.list td {
    text-align: left;
    padding: 7px 8px;
    border-bottom: 1px solid var(--border);
}

/* Long values wrap inside the card; the unit stays attached by a no-break space. */
.list td[data-metric] {
    overflow-wrap: anywhere;
}

.row-actions {
    white-space: nowrap;
    text-align: right;
}

.row-actions form {
    display: inline;
}

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

.actions {
    display: flex;
    justify-content: end;
    gap: 8px;
}

details summary {
    cursor: pointer;
}

/* --- Editor and preview --- */

/* Bar on top, tools on the left, properties on the right; between them the display with its
   rulers, below it the status line. */
.editor {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template: auto minmax(0, 1fr) auto / auto minmax(0, 1fr) 300px;
}

.preview {
    grid-template: auto minmax(0, 1fr) / minmax(0, 1fr);
}

body:has(.editor) {
    height: 100vh;
}

.toolbar {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    min-height: 46px;
    padding: 6px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.toolbar label {
    display: flex;
    align-items: center;
    gap: 6px;
}

.preview .toolbar {
    gap: 10px;
}

.toolbar .control {
    width: 76px;
}

/* The project's name: looks like a heading until the pointer or the cursor is on it. */
.title-input {
    width: 200px;
    border-color: transparent;
    background: transparent;
    font-weight: 600;
}

.title-input:hover {
    background: var(--field);
}

.separator {
    width: 1px;
    align-self: stretch;
    background: var(--border);
    margin: 4px 6px;
}

.spacer {
    flex: 1;
}

/* Whether the project is stored: a dot in the color of the state, then the state. */
.save-status {
    margin-right: 8px;
    font-size: 12px;
    color: var(--muted);
}

.save-status::before {
    content: "●";
    margin-right: 5px;
    color: var(--ok);
}

.save-status[data-state="pending"]::before {
    color: #f59e0b;
}

.save-status[data-state="error"]::before {
    color: var(--danger);
}

.save-status:empty::before {
    content: none;
}

.fetch-urls {
    flex-basis: 100%; /* a line of its own in the toolbar */
    font-size: 0.85em;
    overflow-wrap: anywhere;
}

/* The tools that add an element: icon above name. */
.rail {
    grid-row: 2 / 4;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 8px 6px;
    overflow: auto;
    background: var(--surface);
    border-right: 1px solid var(--border);
}

.rail button {
    flex: none;
    flex-direction: column;
    gap: 3px;
    width: 60px;
    height: 52px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    font-size: 11px;
}

.rail button:hover {
    background: var(--hover);
    color: var(--accent);
}

.rail hr {
    width: 70%;
    margin: 4px auto;
    border: 0;
    border-top: 1px solid var(--border);
}

.canvas {
    grid-area: 2 / 2;
    display: grid;
    grid-template: 20px minmax(0, 1fr) / 20px minmax(0, 1fr);
    min-width: 0;
    min-height: 0;
    background: var(--surface);
}

.ruler {
    display: block;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.statusbar {
    grid-area: 3 / 2;
    display: flex;
    align-items: center;
    gap: 4px;
    height: 36px;
    padding: 0 6px 0 12px;
    background: var(--surface);
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
}

.statusbar > span {
    margin-right: 14px;
    font-variant-numeric: tabular-nums;
}

.statusbar button {
    height: 26px;
}

.statusbar .tool {
    width: 26px;
}

.statusbar .control {
    width: 84px;
    height: 26px;
    color: var(--text);
}

.stage-wrap {
    min-height: 0;
    display: flex;
    overflow: auto;
    padding: 24px;
    background: var(--stage);
}

.display {
    flex: none;
    margin: auto; /* centers, but stays scrollable when the display is larger than the pane */
    box-shadow: 0 0 0 1px var(--border), 0 6px 24px rgb(0 0 0 / 30%);
}

.display text {
    white-space: pre;
}

/* Labels of the editor cannot be marked: marked text would be dragged along by the next pull
   at an element. Inputs are not affected. */
.editor:not(.preview) {
    user-select: none;
}

.editor:not(.preview) .display {
    touch-action: none;
    overflow: visible; /* what lies beside the display still shows and can be pulled back in */
}

.display [data-id] {
    pointer-events: all; /* unfilled shapes and transparent hit lines stay clickable */
    cursor: move;
}

.display svg[data-id] {
    pointer-events: none; /* an icon's strokes carry no id: the box behind it takes the click */
}

.display .locked {
    cursor: default;
}

.selection {
    fill: none;
    stroke: #4f8cff;
    stroke-dasharray: 4 3;
    pointer-events: none;
}

.handle {
    fill: #fff;
    stroke: #4f8cff;
}

.text-box {
    fill: transparent;
    stroke: rgb(128 128 128 / 50%);
    stroke-dasharray: 2 3;
}

.marquee {
    fill: rgb(79 140 255 / 12%);
    stroke: #4f8cff;
    stroke-dasharray: 4 3;
    pointer-events: none;
}

.grid {
    pointer-events: none;
}

/* 2px stroke on the tile edge, half clipped by the pattern tile: a crisp 1px line. */
.grid-line {
    fill: none;
    stroke: rgb(128 128 128 / 40%);
}

/* Editor marks keep a 1px outline at any zoom. */
.selection,
.handle,
.marquee,
.text-box {
    vector-effect: non-scaling-stroke;
}

/* --- Properties: what is selected, in sections that fold --- */

.props {
    grid-area: 2 / 3 / 4 / 4;
    overflow: auto;
    background: var(--surface);
    border-left: 1px solid var(--border);
    font-size: 13px;
}

.props-head {
    position: sticky;
    top: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 2px;
    height: 44px;
    padding: 0 6px 0 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.props-head strong {
    flex: 1;
    margin-left: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.section {
    padding: 0 12px;
    border-bottom: 1px solid var(--border);
}

.section > summary {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 34px;
    margin: 0 -8px;
    list-style: none;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--muted);
    user-select: none;
}

.section > summary::-webkit-details-marker {
    display: none;
}

.section[open] > summary .icon {
    transform: rotate(90deg);
}

.section > :last-child:not(summary) {
    margin-bottom: 12px;
}

/* Twelve columns: a field takes all of them, or shares the line with others. */
.fields {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
    gap: 8px 6px;
}

.field {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.caption {
    font-size: 11px;
    color: var(--muted);
}

.field.check {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 24px;
}

/* :where keeps this weaker than the rules of .control, whose input has no frame of its own. */
.fields :where(input:not([type="checkbox"], [type="color"]), select, .field > button) {
    width: 100%;
    min-width: 0;
    height: 30px;
    background-color: var(--field);
}

.fields .toggle {
    padding: 0;
    font-weight: 800;
}

.fields [aria-pressed="true"] {
    background: var(--accent-soft);
}

.hint {
    margin: 10px 0 6px;
    font-size: 11px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.button-row .tool {
    background: var(--field);
}

.button-row .tool:hover {
    background: var(--hover);
}

.layers {
    display: grid;
    gap: 1px;
    margin: 0 -6px 12px;
}

.layer {
    display: flex;
    align-items: center;
    border-radius: 7px;
}

.layer:hover {
    background: var(--field);
}

.layer.current {
    background: var(--accent-soft);
    color: var(--accent);
}

.layer button {
    height: 30px;
    border: 0;
    background: none;
}

/* Not a flex box like other buttons: only a block cuts its text off with "…". */
.layer-main {
    display: block;
    flex: 1;
    min-width: 0;
    padding: 0 4px 0 8px;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
}

.layer-main .icon {
    margin-right: 8px;
    vertical-align: -3px;
}

.layer.off .layer-main {
    opacity: 0.45;
}

/* Lock and eye show on the row under the pointer, and wherever they are switched on. */
.layer .tool {
    width: 26px;
    color: var(--muted);
    opacity: 0;
}

.layer:hover .tool,
.layer .tool:focus-visible,
.layer .tool[aria-pressed="true"] {
    opacity: 1;
}

.layer .tool[aria-pressed="true"] {
    color: var(--text);
}

/* --- Dialogs --- */

dialog {
    width: min(720px, 94vw);
    max-height: 90vh;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow);
}

dialog::backdrop {
    background: rgb(0 0 0 / 45%);
}

dialog h2 {
    margin: 0 0 6px;
    font-size: 16px;
}

.icon-rule,
.icon-picker-head,
.dialog-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.icon-rule input,
.icon-picker-head input {
    flex: 1;
    min-width: 0;
}

.dialog-actions {
    justify-content: space-between;
    margin: 12px 0 0;
}

.icon-button {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 4px;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 38px);
    gap: 4px;
    max-height: 38vh;
    margin-top: 6px;
    overflow: auto;
}

/* Keys and what they do, in two columns. */
.shortcuts {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    margin: 12px 0 0;
}

.shortcuts dt {
    white-space: nowrap;
}

.shortcuts dd {
    margin: 0;
    color: var(--muted);
}

kbd {
    padding: 1px 6px;
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 5px;
    background: var(--field);
    font: 12px system-ui, sans-serif;
}
