:root {
    --background: #09080b;
    --sidebar: #0e0b10;
    --surface: #151116;
    --surface-raised: #1d1621;
    --surface-soft: #24172e;
    --border: #35283c;
    --border-light: #493354;
    --text: #f8f6f9;
    --muted: #a79eaa;
    --primary: #8b5cf6;
    --primary-dark: #7140e4;
    --primary-light: #c084fc;
    --success: #38d39f;
    --danger: #ff6b76;
    --warning: #fbbf24;
    --radius: 18px;
    --shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
}

* {
    box-sizing: border-box;
}

html {
    color-scheme: dark;
}

body {
    min-width: 320px;
    min-height: 100vh;
    margin: 0;
    color: var(--text);
    background:
        radial-gradient(circle at 85% -10%, rgba(109, 40, 217, 0.16), transparent 30rem),
        var(--background);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
textarea {
    font: inherit;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

.app-layout {
    display: grid;
    grid-template-columns: 252px minmax(0, 1fr);
    min-height: 100vh;
}

.sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 27px 18px 20px;
    border-right: 1px solid #221925;
    background: rgba(14, 11, 16, 0.96);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: inherit;
    text-decoration: none;
}

.brand-mark {
    position: relative;
    display: block;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border: 1px solid #a77aff;
    border-radius: 13px;
    background: linear-gradient(145deg, #9e69ff, #7642e5);
    box-shadow: 0 10px 24px rgba(120, 66, 229, 0.25);
}

.brand-mark i {
    position: absolute;
    top: 14px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: white;
}

.brand-mark i:first-child {
    left: 9px;
    background: transparent;
    border: 3px solid white;
}

.brand-mark i:last-child {
    right: 8px;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    color: #d8b4fe;
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.14em;
}

.brand small {
    margin-top: 3px;
    color: #766e7a;
    font-size: 0.65rem;
}

.sidebar-nav {
    margin-top: 48px;
}

.nav-label {
    display: block;
    margin: 0 11px 9px;
    color: #665d69;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.nav-label-spaced {
    margin-top: 29px;
}

.nav-item {
    display: flex;
    min-height: 45px;
    align-items: center;
    gap: 11px;
    padding: 0 12px;
    border-radius: 10px;
    color: #948b98;
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 700;
    transition: color 140ms ease, background 140ms ease;
}

.nav-item:hover {
    color: white;
    background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
    color: white;
    background: linear-gradient(90deg, rgba(139, 92, 246, 0.22), rgba(139, 92, 246, 0.07));
}

.nav-button {
    width: 100%;
    margin-top: 7px;
    border: 0;
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.token-status {
    margin-left: auto;
    color: var(--warning);
    font-size: 0.57rem;
}

.token-status.connected {
    color: var(--success);
}

.nav-icon {
    display: grid;
    width: 23px;
    height: 23px;
    place-items: center;
    color: var(--primary-light);
    font-size: 1rem;
}

.nav-icon-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.65rem;
    font-weight: 800;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-top: auto;
    padding: 14px;
    border: 1px solid #2b222f;
    border-radius: 11px;
    background: #151117;
}

.connection-dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 0 4px rgba(56, 211, 159, 0.1);
}

.sidebar-footer strong,
.sidebar-footer small {
    display: block;
}

.sidebar-footer strong {
    font-size: 0.7rem;
}

.sidebar-footer small {
    margin-top: 3px;
    color: #766e7a;
    font-size: 0.62rem;
}

.content-area {
    min-width: 0;
}

.mobile-header {
    display: none;
}

.main-content {
    width: min(1180px, calc(100% - 64px));
    margin: 0 auto;
    padding: 52px 0 64px;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 30px;
}

.eyebrow {
    color: var(--primary-light);
    font-size: 0.7rem;
    font-weight: 850;
    letter-spacing: 0.18em;
}

.page-header h1 {
    margin: 6px 0 6px;
    font-size: clamp(2rem, 5vw, 2.75rem);
    letter-spacing: -0.045em;
    line-height: 1.05;
}

.page-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.88rem;
}

.primary-button,
.secondary-button,
.cancel-button {
    min-height: 44px;
    border-radius: 11px;
    cursor: pointer;
    font-size: 0.79rem;
    font-weight: 800;
    transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 18px;
    border: 1px solid #9869fa;
    color: white;
    background: linear-gradient(135deg, #935fff, #7c45eb);
    box-shadow: 0 10px 25px rgba(124, 69, 235, 0.24);
}

.primary-button:hover {
    background: linear-gradient(135deg, #a06dff, #854ff0);
    transform: translateY(-1px);
}

.primary-button:disabled {
    opacity: 0.58;
    cursor: wait;
    transform: none;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 22px;
}

.summary-card {
    min-height: 130px;
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: 15px;
    background: var(--surface);
}

.summary-card-featured {
    border-color: #593b72;
    background:
        radial-gradient(circle at 100% 0, rgba(168, 85, 247, 0.25), transparent 12rem),
        #251331;
}

.summary-card span,
.summary-card strong,
.summary-card small {
    display: block;
}

.summary-card span {
    color: #b9aebe;
    font-size: 0.72rem;
    font-weight: 700;
}

.summary-card strong {
    margin: 10px 0 4px;
    font-size: 1.75rem;
    letter-spacing: -0.04em;
}

.summary-card small {
    color: #756c78;
    font-size: 0.66rem;
}

.patterns-panel {
    min-height: 380px;
}

.panel-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin: 34px 0 18px;
}

.panel-toolbar h2 {
    margin: 0 0 4px;
    font-size: 1.3rem;
    letter-spacing: -0.025em;
}

.panel-toolbar p {
    margin: 0;
    color: #766d79;
    font-size: 0.7rem;
}

.search-field {
    display: flex;
    width: min(290px, 42%);
    min-height: 42px;
    align-items: center;
    gap: 8px;
    padding: 0 13px;
    border: 1px solid var(--border);
    border-radius: 11px;
    color: #817785;
    background: #121014;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.search-field:focus-within {
    border-color: #77549a;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.search-field input {
    width: 100%;
    min-height: 40px;
    border: 0;
    outline: 0;
    color: white;
    background: transparent;
    font-size: 0.75rem;
}

.hamas-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.hama-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.12);
    transition: border-color 160ms ease, transform 160ms ease;
}

.hama-card:hover {
    border-color: #50385b;
    transform: translateY(-2px);
}

.bead-preview {
    display: grid;
    min-height: 190px;
    place-items: center;
    padding: 22px;
    border-bottom: 1px solid #34223e;
    background:
        radial-gradient(circle at 70% 10%, color-mix(in srgb, var(--bead-color) 20%, transparent), transparent 10rem),
        #211329;
}

.bead-preview canvas {
    display: block;
    width: 170px;
    height: 170px;
    border-radius: 8px;
}

.bead-grid {
    display: grid;
    grid-template-columns: repeat(9, 13px);
    gap: 4px;
}

.bead {
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #2d2430;
    box-shadow: inset 0 0 0 3px #171219;
}

.bead.active {
    background: var(--bead-color);
    box-shadow:
        inset 0 0 0 3px color-mix(in srgb, var(--bead-color) 60%, #120d14),
        0 0 8px color-mix(in srgb, var(--bead-color) 32%, transparent);
}

.bead.highlight {
    background: #ffffff;
    box-shadow: inset 0 0 0 3px #d8d4da;
}

.hama-card-body {
    padding: 17px 18px 18px;
}

.hama-card h3 {
    margin: 0;
    overflow: hidden;
    font-size: 1rem;
    letter-spacing: -0.02em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hama-card-description {
    height: 34px;
    margin: 7px 0 13px;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.7rem;
    line-height: 1.45;
}

.hama-meta {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #bcb3bf;
    font-size: 0.68rem;
    font-weight: 700;
}

.hama-meta-divider {
    color: #554b58;
}

.hama-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid #29222c;
}

.color-label {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #8e8491;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.64rem;
}

.color-swatch {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    background: var(--swatch-color);
}

.card-actions {
    display: flex;
    gap: 6px;
}

.action-button {
    min-height: 31px;
    padding: 0 9px;
    border: 1px solid #3b3040;
    border-radius: 8px;
    color: #b6acb9;
    background: #1b161d;
    cursor: pointer;
    font-size: 0.64rem;
    font-weight: 750;
}

.action-button:hover {
    color: white;
    border-color: #6f4c87;
    background: #271b2e;
}

.action-button.delete:hover {
    color: #ff9ca4;
    border-color: #71353c;
    background: #2b171b;
}

.empty-state {
    padding: 70px 20px;
    border: 1px dashed #3a2c40;
    border-radius: var(--radius);
    text-align: center;
    background: rgba(21, 17, 22, 0.5);
}

.empty-beads {
    display: flex;
    width: 84px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 5px;
    margin: 0 auto 17px;
}

.empty-beads i {
    width: 17px;
    height: 17px;
    border: 4px solid #8050e9;
    border-radius: 50%;
}

.empty-state h3 {
    margin: 0 0 7px;
    font-size: 1rem;
}

.empty-state p {
    margin: 0 0 19px;
    color: var(--muted);
    font-size: 0.74rem;
}

.secondary-button,
.cancel-button {
    padding: 0 16px;
    border: 1px solid #45364b;
    color: #c5bbc8;
    background: #1a151c;
}

.secondary-button:hover,
.cancel-button:hover {
    border-color: #6f4c87;
    background: #251b29;
}

.hama-dialog {
    width: min(1180px, calc(100% - 28px));
    max-height: calc(100vh - 28px);
    padding: 0;
    overflow: hidden auto;
    border: 1px solid #4a3554;
    border-radius: 20px;
    color: var(--text);
    background: #130f15;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55);
}

#hama-form {
    display: flex;
    min-height: min(850px, calc(100vh - 30px));
    flex-direction: column;
}

.hama-dialog::backdrop {
    background: rgba(4, 3, 5, 0.76);
    backdrop-filter: blur(4px);
}

.dialog-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    padding: 25px 27px 19px;
    border-bottom: 1px solid #2d2430;
}

.dialog-header span {
    color: var(--primary-light);
    font-size: 0.65rem;
    font-weight: 850;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.dialog-header h2 {
    margin: 5px 0;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.dialog-header p {
    margin: 0;
    color: var(--muted);
    font-size: 0.72rem;
}

.close-button {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    padding: 0;
    border: 1px solid #3b303f;
    border-radius: 9px;
    color: #aaa0ad;
    background: #1b161d;
    cursor: pointer;
    font-size: 1.2rem;
}

.close-button:hover {
    color: white;
    background: #28202b;
}

.dialog-body {
    padding: 23px 27px 8px;
}

.creator-body {
    flex: 1;
    padding-bottom: 22px;
}

.creator-layout {
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 26px;
    align-items: start;
}

.creator-controls {
    min-width: 0;
}

.pattern-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 2px 0 4px;
}

.pattern-metrics > div {
    padding: 12px;
    border: 1px solid #3a2d40;
    border-radius: 10px;
    background: #1b151e;
}

.pattern-metrics span,
.pattern-metrics strong {
    display: block;
}

.pattern-metrics span {
    margin-bottom: 5px;
    color: #817786;
    font-size: 0.6rem;
}

.pattern-metrics strong {
    font-size: 0.85rem;
}

.pattern-error {
    margin-bottom: 11px;
}

.live-preview-card {
    display: grid;
    grid-template-columns: 1fr 92px;
    align-items: center;
    gap: 12px;
    margin: 8px 0 16px;
    padding: 11px;
    border: 1px solid #3a2d40;
    border-radius: 11px;
    background: linear-gradient(135deg, #1d1521, #25172e);
}

.live-preview-card strong,
.live-preview-card small {
    display: block;
}

.live-preview-card strong {
    margin-bottom: 5px;
    font-size: 0.75rem;
}

.live-preview-card small {
    color: #8f8493;
    font-size: 0.61rem;
    line-height: 1.45;
}

.live-preview-card canvas {
    width: 92px;
    height: 92px;
    border: 1px solid #604272;
    border-radius: 9px;
    background: #211329;
    image-rendering: auto;
}

.field-group {
    margin-bottom: 16px;
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.field-row-three {
    grid-template-columns: repeat(3, 1fr);
}

.field-group label {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 7px;
    color: #ded8e0;
    font-size: 0.7rem;
    font-weight: 750;
}

.field-group label span {
    color: #ff818b;
}

.field-group label em {
    margin-left: auto;
    color: #736a76;
    font-size: 0.61rem;
    font-style: normal;
    font-weight: 500;
}

.field-group input:not([type="color"]),
.field-group textarea {
    width: 100%;
    padding: 11px 12px;
    border: 1px solid #3a2d40;
    border-radius: 9px;
    outline: 0;
    color: white;
    background: #1d1521;
    font-size: 0.76rem;
    transition: border-color 140ms ease, box-shadow 140ms ease;
}

.field-group textarea {
    min-height: 86px;
    resize: vertical;
}

.field-group input:focus,
.field-group textarea:focus {
    border-color: #8055aa;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.11);
}

.field-group .input-error {
    border-color: var(--danger) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 118, 0.08) !important;
}

.field-error {
    display: block;
    min-height: 15px;
    margin-top: 4px;
    color: #ff8992;
    font-size: 0.62rem;
}

.color-picker-row {
    display: flex;
    min-height: 50px;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border: 1px solid #3a2d40;
    border-radius: 10px;
    background: #1d1521;
}

.active-color-row {
    display: flex;
    min-height: 58px;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border: 1px solid #3a2d40;
    border-radius: 10px;
    background: #1d1521;
}

.active-color-row strong,
.active-color-row code {
    display: block;
}

.active-color-row strong {
    margin-bottom: 3px;
    color: #d8d0db;
    font-size: 0.69rem;
}

.active-color-row code {
    color: #958a99;
    font-size: 0.64rem;
}

#color_principal {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    padding: 0;
    overflow: hidden;
    border: 2px solid white;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

#color_principal::-webkit-color-swatch-wrapper {
    padding: 0;
}

#color_principal::-webkit-color-swatch {
    border: 0;
    border-radius: 50%;
}

#color-value {
    color: #bdb2c0;
    font-size: 0.68rem;
}

.quick-colors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 9px;
}

.quick-colors button {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, 0.24);
    border-radius: 50%;
    background: var(--quick-color);
    cursor: pointer;
}

.quick-colors button:hover,
.quick-colors button.selected {
    border-color: white;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22);
}

.drawing-tools {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 7px;
    margin-top: 4px;
}

.tool-button {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 8px;
    border: 1px solid #3c3041;
    border-radius: 9px;
    color: #a99fad;
    background: #1a151c;
    cursor: pointer;
    font-size: 0.65rem;
    font-weight: 750;
}

.tool-button span {
    font-size: 0.9rem;
}

.tool-button:hover,
.tool-button.selected {
    color: white;
    border-color: #8e61bc;
    background: #38204a;
}

.tool-button.danger:hover {
    color: #ff9ca4;
    border-color: #71353c;
    background: #2b171b;
}

.pattern-editor {
    min-width: 0;
}

.pattern-editor-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 12px;
}

.pattern-editor-heading h3 {
    margin: 0 0 4px;
    font-size: 0.93rem;
}

.pattern-editor-heading p {
    margin: 0;
    color: #807684;
    font-size: 0.65rem;
}

.editor-history {
    display: flex;
    align-items: center;
    gap: 7px;
}

.editor-history button {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    padding: 0;
    border: 1px solid #46354d;
    border-radius: 8px;
    color: #e8dff0;
    background: #1c1520;
    cursor: pointer;
    font-size: 1rem;
}

.editor-history button:hover:not(:disabled) {
    border-color: #8e61bc;
    background: #38204a;
}

.editor-history button:disabled {
    color: #5e5561;
    cursor: not-allowed;
    opacity: 0.55;
}

.editor-history > span {
    color: #8c8190;
    font-size: 0.66rem;
    white-space: nowrap;
}

.pattern-editor-heading b {
    color: var(--primary-light);
    font-size: 0.82rem;
}

.canvas-scroll {
    overflow: auto;
    padding: 0 0 7px;
    border: 1px solid #3a2942;
    border-radius: 13px;
    background: #0c090e;
}

.canvas-stage {
    position: relative;
    width: 704px;
    min-width: 704px;
    padding: 32px 18px 18px 36px;
}

.axis-top {
    position: absolute;
    top: 7px;
    left: 36px;
    display: flex;
    width: 650px;
    justify-content: space-between;
    color: #7e7283;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.58rem;
}

.axis-left {
    position: absolute;
    top: 32px;
    left: 9px;
    display: flex;
    height: 650px;
    flex-direction: column;
    justify-content: space-between;
    color: #7e7283;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.58rem;
}

.hama-canvas {
    display: grid;
    width: 650px;
    height: 650px;
    grid-template-columns: repeat(50, 1fr);
    grid-template-rows: repeat(50, 1fr);
    gap: 1px;
    padding: 2px;
    border: 2px solid #a96ce6;
    background: #8f7d98;
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.12);
    touch-action: none;
    user-select: none;
}

.hama-canvas[data-tool="fill"] .canvas-cell {
    cursor: cell;
}

.hama-canvas[data-tool="eraser"] .canvas-cell {
    cursor: not-allowed;
}

.canvas-cell {
    min-width: 0;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    outline: 0;
    background: #f7f4f9;
    box-shadow: inset 0 0 0 2px #c5bbc9;
    cursor: crosshair;
}

.canvas-cell:hover,
.canvas-cell:focus-visible {
    position: relative;
    z-index: 1;
    box-shadow: inset 0 0 0 2px #6e3b9e, 0 0 0 2px #d5a5ff;
}

.canvas-cell.painted {
    background: var(--cell-color);
    box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--cell-color) 58%, #120d14);
}

.canvas-error {
    margin-top: 5px;
}

.dialog-footer {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    padding: 18px 27px 23px;
    border-top: 1px solid #2d2430;
    background: #110d13;
    position: sticky;
    bottom: 0;
    z-index: 3;
}

.toast {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 20;
    max-width: min(370px, calc(100% - 48px));
    padding: 13px 16px;
    border: 1px solid #4e3a58;
    border-radius: 10px;
    color: white;
    background: #25172e;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
    font-size: 0.72rem;
    font-weight: 750;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 170ms ease, transform 170ms ease;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    border-color: #723b42;
    background: #321a1e;
}

.passport-dialog {
    width: min(520px, calc(100% - 28px));
    padding: 0;
    border: 1px solid var(--border-light);
    border-radius: 18px;
    color: var(--text);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.passport-dialog::backdrop {
    background: rgba(4, 3, 5, 0.82);
    backdrop-filter: blur(5px);
}

.passport-dialog form {
    padding: 28px;
}

.passport-dialog h2 {
    margin: 8px 0 7px;
    font-size: 1.55rem;
}

.passport-dialog p {
    margin: 0 0 21px;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.6;
}

.passport-dialog label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.72rem;
    font-weight: 800;
}

.passport-dialog textarea {
    width: 100%;
    resize: vertical;
    padding: 13px;
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    background: #100c12;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
    line-height: 1.5;
}

.passport-dialog textarea:focus {
    border-color: var(--primary);
    outline: 3px solid rgba(139, 92, 246, 0.15);
}

.passport-dialog-actions {
    display: flex;
    justify-content: flex-end;
    gap: 9px;
    margin-top: 19px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 1040px) {
    .hamas-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 860px) {
    .app-layout {
        display: block;
    }

    .sidebar {
        display: none;
    }

    .mobile-header {
        display: flex;
        min-height: 68px;
        align-items: center;
        justify-content: space-between;
        padding: 11px 22px;
        border-bottom: 1px solid #251d28;
        background: #0e0b10;
    }

    .mobile-status {
        display: inline-flex;
        align-items: center;
        gap: 7px;
        color: #908695;
        font-size: 0.65rem;
        font-weight: 700;
    }

    .mobile-status span {
        width: 7px;
        height: 7px;
        border-radius: 50%;
        background: var(--success);
    }

    .main-content {
        width: min(100% - 38px, 900px);
        padding-top: 38px;
    }

    .creator-layout {
        grid-template-columns: 1fr;
    }

    .creator-controls {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 14px;
    }

    .creator-controls .color-field-group,
    .creator-controls .live-preview-card,
    .creator-controls .drawing-tools {
        grid-column: 1 / -1;
    }
}

@media (max-width: 650px) {
    .page-header {
        align-items: stretch;
        flex-direction: column;
    }

    .page-header .primary-button {
        align-self: flex-start;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        min-height: 112px;
    }

    .panel-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .search-field {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .main-content {
        width: calc(100% - 26px);
        padding: 30px 0 45px;
    }

    .page-header .primary-button {
        width: 100%;
    }

    .hamas-grid {
        grid-template-columns: 1fr;
    }

    .field-row-three {
        grid-template-columns: 1fr 1fr;
    }

    .creator-controls {
        display: block;
    }

    .canvas-stage {
        transform-origin: top left;
    }

    .field-row-three .field-group:last-child {
        grid-column: 1 / -1;
    }

    .color-picker-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .quick-colors {
        width: 100%;
        margin: 3px 0 0;
    }

    .dialog-header,
    .dialog-body,
    .dialog-footer {
        padding-right: 19px;
        padding-left: 19px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
