/* Klaim — minimal black monospace on white, accent #6728F6 */

:root {
    --accent: #6728F6;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.site-header {
    text-align: center;
    padding: 24px 16px 8px;
}

.site-header a {
    display: inline-block;
    text-decoration: none;
    border: none;
}

.site-logo {
    height: 40px;
    width: auto;
    display: block;
    margin: 0 auto;
}

.title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.title-row h1 {
    margin: 0;
}

.title-actions {
    display: flex;
    align-items: baseline;
    gap: 16px;
    flex-wrap: wrap;
}

.link-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    color: var(--accent);
    text-decoration: underline;
    cursor: pointer;
    font: inherit;
    display: inline;
}

.link-btn:hover {
    color: #000;
    background: transparent;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 12px 0 24px;
    flex-wrap: wrap;
}

.inline-form[hidden] {
    display: none !important;
}

.inline-form label {
    margin: 0;
}

.inline-form input[type="number"] {
    width: 160px;
    margin: 0;
}

.inline-form input[type="text"] {
    width: 240px;
    margin: 0;
}

.inline-form button {
    margin: 0;
}

/* Create-claim-code form: each field stacks its label above its input,
   and the fields + button sit on one horizontal row. align-items: flex-end
   keeps the input bottoms and the button bottom on the same baseline. */
.create-claim-form {
    align-items: flex-end;
    gap: 12px;
}

.create-claim-form .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.create-claim-form .field label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #555;
    margin: 0;
}

.section-hint {
    margin: 8px 0 12px;
}

.label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 4px;
}

.label-row label {
    margin-bottom: 0;
}

.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 1px solid #bbb;
    background: #fff;
    color: #888;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    text-transform: lowercase;
}

.info-btn:hover,
.info-btn:focus {
    background: #eee;
    color: #555;
    border-color: #888;
    outline: none;
}

/* Collapsible section toggle (Lightning address, BOLT11). Looks like a label,
   not a primary button. The chevron rotates when expanded. */
.collapse-toggle {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 4px 0;
    margin: 0;
    color: #000;
    font: inherit;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    text-align: left;
    line-height: 1.5;
    cursor: pointer;
    border-radius: 0;
}

.collapse-toggle:hover,
.collapse-toggle:focus {
    background: transparent;
    color: var(--accent);
    outline: none;
}

.collapse-toggle:focus-visible .label-text {
    text-decoration: underline;
}

.collapse-toggle .chevron {
    display: inline-block;
    font-size: 10px;
    color: #888;
    transition: transform 0.15s ease;
    width: 10px;
    text-align: center;
}

.collapse-toggle:hover .chevron,
.collapse-toggle:focus .chevron {
    color: var(--accent);
}

.collapse-toggle[aria-expanded="true"] .chevron {
    transform: rotate(90deg);
}

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

/* Extra breathing room above the primary submit button on the claim form,
   so it doesn't crowd the last collapsible row. */
.submit-spaced {
    margin-top: 24px;
}

/* Tighten the gap when a collapsed section sits above the next label-row,
   since the textarea/input that normally sits between them is hidden. */
.label-row + .collapsible[hidden] + .label-row {
    margin-top: 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;
}

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

.modal {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
}

.modal-panel {
    position: relative;
    background: #fff;
    border: 1px solid #000;
    padding: 24px 28px 20px;
    max-width: 420px;
    width: 100%;
}

.modal-title {
    font-size: 14px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    padding-right: 24px;
}

.modal-body {
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.modal-close {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: none;
    color: var(--accent);
    font: inherit;
    font-size: 20px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}

.modal-close:hover {
    background: transparent;
    color: #000;
}

.prefix-input {
    display: flex;
    align-items: stretch;
    margin-bottom: 16px;
}

.prefix-input .prefix {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border: 1px solid #000;
    border-right: none;
    background: #f5f5f5;
    color: #000;
    font: inherit;
    user-select: none;
}

.prefix-input input[type="text"] {
    flex: 1;
    margin: 0;
    border-left: none;
}

.prefix-input input[type="text"]:focus {
    box-shadow: inset 0 0 0 1px #000;
}

textarea {
    resize: vertical;
    font-family: inherit;
    font-size: 12px;
    line-height: 1.4;
    word-break: break-all;
}

html, body {
    background: #ffffff;
    color: #000000;
    font-family: "SFMono-Regular", "Menlo", "Monaco", "Consolas",
                 "Liberation Mono", "Courier New", monospace;
    font-size: 14px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: #000;
    text-decoration: underline;
}

a:hover {
    text-decoration: none;
}

main {
    max-width: 720px;
    margin: 0 auto;
    padding: 64px 24px;
}

.tight {
    max-width: 480px;
}

.wide {
    max-width: 1100px;
}

h1, h2, h3 {
    font-weight: 700;
    text-transform: lowercase;
    letter-spacing: -0.01em;
}

h1 {
    font-size: 18px;
    margin-bottom: 32px;
}

h2 {
    font-size: 14px;
    margin: 32px 0 12px;
}

h3 {
    font-size: 14px;
    margin: 16px 0 8px;
    font-weight: 700;
}

p {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

input[type="text"],
input[type="number"],
input[type="email"],
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #000;
    background: #fff;
    color: #000;
    font: inherit;
    border-radius: 0;
    margin-bottom: 16px;
}

input:focus, textarea:focus {
    outline: none;
    border-color: #000;
    box-shadow: inset 0 0 0 1px #000;
}

button, .btn {
    display: inline-block;
    padding: 10px 16px;
    border: 1px solid var(--accent);
    background: var(--accent);
    color: #fff;
    font: inherit;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    border-radius: 0;
}

button:hover, .btn:hover {
    background: #fff;
    color: var(--accent);
    text-decoration: none;
}

.btn-secondary {
    background: #fff;
    color: var(--accent);
}

.btn-secondary:hover {
    background: var(--accent);
    color: #fff;
}

hr {
    border: none;
    border-top: 1px solid #000;
    margin: 32px 0;
}

.muted {
    color: #666;
}

.small {
    font-size: 12px;
}

.error {
    border: 1px solid #000;
    padding: 12px;
    margin-bottom: 16px;
    background: #fde2e2;
    color: #000;
}

.error ul.attempt-errors {
    margin: 8px 0 0 18px;
    padding: 0;
    font-size: 12px;
}

.error ul.attempt-errors li {
    margin: 4px 0;
}

.notice {
    position: relative;
    border: 1px solid var(--accent);
    background: #ede4fe;
    color: #000;
    padding: 12px 40px 12px 12px;
    margin-bottom: 16px;
}

.notice-dismiss {
    position: absolute;
    top: 4px;
    right: 6px;
    background: transparent;
    border: none;
    color: var(--accent);
    font: inherit;
    font-size: 18px;
    line-height: 1;
    padding: 4px 8px;
    cursor: pointer;
}

.notice-dismiss:hover {
    background: transparent;
    color: #000;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0 24px;
    font-size: 13px;
}

th, td {
    text-align: left;
    padding: 8px 8px;
    border-bottom: 1px solid #000;
    vertical-align: top;
}

th {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 11px;
    border-bottom: 2px solid #000;
}

/* Don't break the 8-char claim code or short label cells across lines. */
td > code,
td .tag {
    white-space: nowrap;
    word-break: keep-all;
}

td.paid-to .trunc {
    word-break: keep-all;
}

code, pre, .mono {
    font-family: inherit;
    font-size: 12px;
    word-break: break-all;
}

pre {
    border: 1px solid #000;
    padding: 12px;
    background: #fafafa;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.invoice-box {
    border: 1px solid #000;
    padding: 12px;
    background: #fafafa;
    word-break: break-all;
    user-select: all;
    font-size: 11px;
    margin-bottom: 16px;
}

.qr {
    display: block;
    width: 280px;
    height: 280px;
    margin: 16px 0;
    border: 1px solid #000;
}

.row {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.stat {
    border: 1px solid #000;
    padding: 12px 16px;
    flex: 1 1 auto;
    min-width: 140px;
}

.stat .label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #000;
    margin-bottom: 6px;
    display: block;
}

.stat .value {
    font-size: 18px;
    font-weight: 700;
}

.tag {
    display: inline-block;
    padding: 2px 6px;
    border: 1px solid #000;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.tag-claimed {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

#loading-overlay[hidden] {
    display: none !important;
}

#loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    padding: 24px;
}

#loading-overlay .overlay-inner {
    text-align: center;
    max-width: 420px;
}

#loading-overlay p {
    margin-top: 16px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    margin: 0 auto;
    animation: klaim-spin 0.8s linear infinite;
}

@keyframes klaim-spin {
    to { transform: rotate(360deg); }
}

button:disabled, .btn:disabled {
    opacity: 0.6;
    cursor: wait;
}

.btn-copy {
    padding: 4px 10px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    background: #fff;
    color: var(--accent);
    border: 1px solid var(--accent);
    cursor: pointer;
    border-radius: 0;
    line-height: 1;
}

.btn-copy:hover {
    background: var(--accent);
    color: #fff;
}

.btn-copy.is-copied {
    background: var(--accent);
    color: #fff;
}

.tag-pending {
    background: #fff;
    color: #000;
}

header.nav {
    border-bottom: 1px solid #000;
    padding: 12px 0;
    margin-bottom: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

/* Inner container that constrains the nav contents to the same width and
   horizontal padding as the page's <main> element, so the left action and
   right user-stack line up with the left and right edges of the main
   content box rather than the viewport edges. Width modifiers below match
   the corresponding main width modifiers. */
.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.nav-inner.medium { max-width: 720px; }
.nav-inner.tight { max-width: 480px; }

header.nav .brand {
    font-weight: 700;
    text-decoration: none;
}

header.nav nav a {
    margin-left: 16px;
}

/* The signed-in admin's email and the "log out" link sit on a single
   horizontal row at the right end of the nav, vertically centered with
   the action link on the left side of the bar. */
.nav-user {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;
    margin-left: 16px;
}

.nav-user a {
    margin-left: 0;
}

footer {
    border-top: 1px solid #000;
    padding: 24px;
    margin-top: 48px;
    text-align: center;
    color: #666;
    font-size: 11px;
}

.center {
    text-align: center;
}

.success-screen {
    text-align: center;
    padding: 96px 24px;
}

.success-screen h1 {
    font-size: 24px;
    margin-bottom: 16px;
}

.copy-btn {
    margin-left: 8px;
    padding: 4px 8px;
    font-size: 11px;
}
