:root {
    --bg: #111;
    --panel: #151515;
    --ink: #eaeaea;
    --muted: #a8a8a8;
    --line: #262626;
    --accent: #ff6a00;
    --accent-2: #ff842b;
    --shadow: 0 10px 30px rgba(0, 0, 0, .35);
    --radius: 14px;

    --btn-fg: #111;
    --btn-grad-1: var(--accent);
    --btn-grad-2: var(--accent-2);
    --btn-grad-1-hover: #ff7a1f;
    --btn-grad-2-hover: #ffa366;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font: 16px/1.45 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

.container {
    max-width: 820px;
    margin: 48px auto;
    padding: 0 20px
}

.header {
    margin-bottom: 18px;
    border-bottom: 1px solid var(--line);
    padding: 0 0 14px
}

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

.logo {
    width: 28px;
    height: 28px;
    display: block
}

.titles h1 {
    margin: 0;
    font-size: 26px;
    letter-spacing: .2px;
    line-height: 1.2
}

.sub {
    margin: 2px 0 0;
    color: var(--muted);
    font-size: 14px
}

.card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px clamp(16px, 2.5vw, 24px);
}

/* DETAILS (выпадашка) */
.settings {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #121212;
    padding: 6px;
}

.settings + .actions {
    margin-top: 16px
}

.settings-summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 40px 12px 14px;
    border-radius: 10px;
    display: block;
    background: #0f0f0f;
    border: 1px solid #1e1e1e;
    user-select: none;
    position: relative;
    line-height: 1.2;
}

.settings-summary::-webkit-details-marker {
    display: none
}

.settings-summary::after {
    content: "";
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--ink);
    border-bottom: 2px solid var(--ink);
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    transition: transform .15s ease;
    opacity: .85;
}

.settings[open] .settings-summary::after {
    transform: translateY(-50%) rotate(-135deg);
}

.options {
    margin-top: 10px;
    padding: 10px;
    border-top: 1px dashed #1f1f1f;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px 16px;
    align-items: center;
}

.row {
    display: contents
}

.row > span {
    color: var(--ink)
}

.row em {
    color: var(--muted);
    font-style: normal;
    font-size: .92em;
    margin-left: .35em
}

select, input[type="text"] {
    background: #0f0f0f;
    color: var(--ink);
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    outline: none;
    height: 40px;
}

select:focus, input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, .15);
}

.checkbox {
    display: contents
}

.checkbox input {
    appearance: auto;
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    justify-self: end;
}

.actions {
    display: flex;
    justify-content: center;
    margin: 8px 0 12px;
    gap: 12px;
}

.btn {
    background: #1a1a1a;
    border: 1px solid var(--line);
    color: var(--ink);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 14px;
    cursor: pointer;
    transition: transform .06s ease,
    border-color .15s ease,
    background .15s ease,
    box-shadow .15s ease,
    filter .15s ease;
}

.btn:hover {
    background: #202020;
    border-color: #2e2e2e
}

.btn:active {
    transform: translateY(1px)
}

.btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #111, 0 0 0 4px rgba(255, 106, 0, .45);
}

.btn-accent {
    background: linear-gradient(180deg, var(--btn-grad-1), var(--btn-grad-2));
    border-color: transparent;
    color: var(--btn-fg);
    font-weight: 600;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .15)
}

.btn-accent:hover {
    background: linear-gradient(180deg, var(--btn-grad-1-hover), var(--btn-grad-2-hover));
    box-shadow: 0 0 0 3px rgba(255, 106, 0, .18), 0 8px 24px rgba(0, 0, 0, .35);
}

.btn-accent:active {
    transform: translateY(1px);
    box-shadow: 0 0 0 2px rgba(255, 106, 0, .22) inset;
}

/* ghost-кнопка (для Clear) */
.btn-ghost {
    background: #131313;
    border-color: #232323;
    color: var(--muted);
}

.btn-ghost:hover {
    background: #171717;
    border-color: #2a2a2a;
    color: var(--ink)
}

.result-wrap {
    margin-top: 8px
}

.result-wrap label {
    display: block;
    font-size: 13px;
    color: var(--muted);
    margin: 0 0 6px
}

.result-row {
    display: flex;
    gap: 8px;
    align-items: center
}

.result {
    flex: 1;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    letter-spacing: .2px;
    /*cursor: copy;*/
    user-select: all;
}

.result.copied {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px rgba(255, 106, 0, .22);
    transition: box-shadow .15s ease, border-color .15s ease;
}

.hint {
    margin: .5rem 0 0;
    color: #ffb199;
    font-size: 13px
}

/* HISTORY */
.history-wrap {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px dashed #1f1f1f;
}

.history-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.history-title {
    font-size: 14px;
    margin: 0;
    color: var(--muted);
    letter-spacing: .2px;
}

.history-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.history-item {
    width: 100%;
    text-align: left;
    background: #0f0f0f;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.history-item:hover {
    border-color: #2e2e2e
}

.history-item:active {
    transform: translateY(1px)
}

.history-item:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #111, 0 0 0 4px rgba(255, 106, 0, .45);
}

.history-item.copied {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 106, 0, .22);
}

.footer {
    margin-top: 18px;
    color: var(--muted);
    font-size: 13px;
    user-select: none;
    text-align: center;
    opacity: .8;
}

@media (prefers-reduced-motion: reduce) {
    .btn, .btn-accent, .settings-summary::after {
        transition: none
    }
}
