.login-form small {
    display: block;
    margin: -9px 0 18px;
    color: var(--muted);
    line-height: 1.4;
}

.creation-panel {
    margin: 0 0 40px;
    border-block: 1px solid var(--line);
    background: #ffffff88;
}

.creation-panel summary {
    padding: 16px 2px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 650;
    cursor: pointer;
}

.admin-form {
    display: grid;
    grid-template-columns: 2fr repeat(3, 1fr);
    gap: 16px;
    padding: 8px 2px 22px;
}

.admin-form label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 650;
}

.admin-form input {
    display: block;
    width: 100%;
    min-height: 40px;
    margin-top: 6px;
    padding: 8px 10px;
    border: 1px solid #cbd5e2;
    border-radius: 6px;
    color: var(--ink);
    font: inherit;
}

.admin-form label.choice {
    display: flex;
    gap: 8px;
    align-items: center;
    align-self: end;
    min-height: 40px;
    color: var(--ink);
}

.admin-form label.choice input {
    display: inline-block;
    width: 16px;
    min-height: 16px;
    margin: 0;
}

.admin-form .wide { grid-column: 1 / -2; }

.admin-form button,
.row-actions button {
    min-height: 36px;
    padding: 7px 12px;
    border: 1px solid var(--portal-accent);
    border-radius: 6px;
    background: var(--portal-accent);
    color: #fff;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}

.admin-form button { align-self: end; }
.row-actions { display: flex; gap: 6px; white-space: nowrap; }
.row-actions form { margin: 0; }
.row-actions .edit-license-trigger {
    min-height: 36px;
    box-sizing: border-box;
    padding: 8px 12px;
    border: 1px solid #b8c4d2;
    border-radius: 6px;
    background: transparent !important;
    color: #53657b;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}
.row-actions .edit-license-trigger:hover {
    border-color: var(--portal-accent);
    background: #fff8f2 !important;
    color: #b6530b;
}
.row-actions .edit-license-trigger:focus-visible {
    border-color: var(--portal-accent);
    color: #b6530b;
    outline: 2px solid #ea7d2666;
    outline-offset: 2px;
}

.license-edit-dialog {
    width: min(720px, calc(100vw - 32px));
    max-width: none;
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    border: 0;
    border-radius: 14px;
    background: #fff;
    color: var(--ink);
    box-shadow: 0 28px 80px #17263e45;
    white-space: normal;
}
.license-edit-dialog[open] { animation: license-dialog-in .16s ease-out; }
.license-edit-dialog::backdrop { background: #17263e99; backdrop-filter: blur(2px); }
.edit-dialog-shell { padding: clamp(22px, 4vw, 34px); }
.edit-dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--line);
}
.edit-dialog-header span {
    color: var(--portal-accent);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.edit-dialog-header h2 { margin: 5px 0 4px; font-size: clamp(22px, 4vw, 28px); letter-spacing: -.03em; }
.edit-dialog-header p {
    margin: 0;
    overflow-wrap: anywhere;
    color: var(--muted);
    font-family: ui-monospace, Consolas, monospace;
    font-size: 10px;
}
.row-actions .dialog-close {
    flex: 0 0 auto;
    width: 36px;
    min-height: 36px;
    padding: 0;
    border-color: var(--line);
    border-radius: 50%;
    background: transparent;
    color: var(--muted);
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
}
.row-actions .dialog-close:hover,
.row-actions .dialog-close:focus-visible { border-color: var(--ink); color: var(--ink); }
.edit-license-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 28px;
}
.edit-field { min-width: 0; }
.edit-field-wide { grid-column: 1 / -1; }
.edit-field > label:first-child { color: #46566d; font-size: 12px; font-weight: 700; }
.edit-field > input:not([type="checkbox"]) {
    display: block;
    width: 100%;
    min-height: 42px;
    box-sizing: border-box;
    margin-top: 7px;
    padding: 9px 11px;
    border: 1px solid #cbd5e2;
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
}
.edit-field > input:focus { outline: 2px solid var(--portal-accent); outline-offset: 2px; }
.edit-field > input:disabled { background: #eef2f6; color: #8794a5; cursor: not-allowed; }
.edit-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-top: 14px;
    color: var(--ink);
    cursor: pointer;
}
.edit-toggle input { flex: 0 0 auto; width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--portal-accent); }
.edit-toggle span { display: grid; gap: 2px; }
.edit-toggle strong { font-size: 12px; }
.edit-toggle small,
.field-help { color: var(--muted); font-size: 11px; font-weight: 400; line-height: 1.45; }
.field-help { display: block; margin-top: 8px; }
.edit-dialog-actions {
    grid-column: 1 / -1;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.row-actions .edit-dialog-actions button { min-width: 132px; min-height: 42px; font-size: 13px; }
.row-actions .edit-dialog-actions .quiet { background: transparent; }
.row-actions .quiet { border-color: #b8c4d2; background: transparent; color: #53657b; }
.row-actions .danger { border-color: #b42318; background: #fff; color: #b42318; }
.row-actions .danger:hover,
.row-actions .danger:focus-visible { background: #b42318; color: #fff; }
.row-actions button:disabled { opacity: .45; cursor: not-allowed; }

.one-time-secret {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 8px 26px;
    align-items: center;
    margin: 0 0 34px;
    padding: 20px 24px;
    border-left: 4px solid var(--portal-accent);
    background: #fff;
}

.one-time-secret h2 { margin: 0; font-size: 18px; }
.one-time-secret .eyebrow { margin-bottom: 4px; }
.one-time-secret code {
    justify-self: start;
    padding: 10px 13px;
    border-radius: 5px;
    background: #17263e;
    color: #fff;
    font-size: 16px;
    letter-spacing: .04em;
}
.one-time-secret > p { grid-column: 1 / -1; margin: 0; color: var(--muted); font-size: 12px; }

@media (max-width: 900px) {
    .admin-form { grid-template-columns: 1fr 1fr; }
    .admin-form .wide { grid-column: 1 / -1; }
    .row-actions { display: grid; }
}

@media (max-width: 760px) {
    .admin-form { grid-template-columns: 1fr; }
    .admin-form .wide { grid-column: auto; }
    .one-time-secret { display: block; }
    .one-time-secret code { display: inline-block; margin: 14px 0; }
    .license-edit-dialog { width: calc(100vw - 20px); max-height: calc(100dvh - 20px); border-radius: 10px; }
    .edit-dialog-shell { padding: 20px; }
    .edit-dialog-header { margin-bottom: 22px; }
    .edit-license-form { grid-template-columns: 1fr; gap: 22px; }
    .edit-field-wide { grid-column: auto; }
    .edit-dialog-actions { flex-direction: column-reverse; }
    .row-actions .edit-dialog-actions button { width: 100%; }
}

@keyframes license-dialog-in {
    from { opacity: 0; transform: translateY(10px) scale(.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .license-edit-dialog[open] { animation: none; }
}
