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

.utility-intro {
    margin-bottom: 28px;
    text-align: center;
}

.utility-intro h1 {
    margin: 0;
    color: #3b1020;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.2;
    letter-spacing: -0.035em;
}

.utility-intro > p {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
}

.utility-privacy-note {
    width: fit-content;
    margin: 14px auto 0;
    padding: 7px 12px;
    border: 1px solid #efd9df;
    border-radius: 999px;
    background: #fff;
    color: #76515e;
    font-size: 12px;
}

.utility-card {
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 14px 38px rgba(75, 18, 39, 0.07);
}

.qr-workspace {
    padding: 26px;
}

.utility-panel {
    overflow: hidden;
    border: 1px solid #ead5dc;
    border-radius: 13px;
    background: #fff;
}

.utility-panel--result {
    background: #fffbfc;
}

.utility-panel__header {
    min-height: 62px;
    padding: 11px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #f0dfe4;
    background: #fffafb;
}

.utility-panel__header strong {
    display: block;
    color: #4c1c2c;
    font-size: 14px;
}

.utility-panel__hint {
    display: block;
    margin-top: 3px;
    color: #9a7d87;
    font-size: 11px;
}

.utility-panel__tools {
    display: flex;
    align-items: center;
    gap: 12px;
    white-space: nowrap;
}

.utility-count {
    color: #9a7d87;
    font-size: 11px;
}

.text-button {
    padding: 6px 9px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: var(--primary);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
}

.text-button:hover:not(:disabled) {
    background: #fff1f2;
}

.text-button:disabled {
    color: #c9b5bc;
    cursor: default;
}

.utility-textarea {
    display: block;
    width: 100%;
    min-height: 180px;
    resize: vertical;
    padding: 17px 18px;
    border: 0;
    outline: 0;
    background: #fff;
    color: #332029;
    font: 14px/1.75 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

.utility-textarea:focus {
    box-shadow: inset 0 0 0 2px rgba(159, 18, 57, 0.12);
}

.utility-textarea::placeholder {
    color: #c1aab2;
}

.qr-options {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-top: 18px;
    padding: 17px;
    border: 1px solid #ead5dc;
    border-radius: 13px;
    background: #fffafb;
}

.qr-option {
    display: grid;
    align-content: start;
    gap: 7px;
}

.qr-option > span:first-child {
    color: #4c1c2c;
    font-size: 12px;
    font-weight: 800;
}

.qr-option select,
.qr-color-control input[type="text"] {
    width: 100%;
    height: 38px;
    padding: 0 11px;
    border: 1px solid #dec6cf;
    border-radius: 8px;
    outline: 0;
    background: #fff;
    color: #4c1c2c;
    font-size: 13px;
}

.qr-option select:focus,
.qr-color-control input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(159, 18, 57, 0.08);
}

.qr-color-control {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 7px;
}

.qr-color-control input[type="color"] {
    width: 44px;
    height: 38px;
    padding: 3px;
    border: 1px solid #dec6cf;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.utility-action-row {
    min-height: 86px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.utility-primary-button {
    min-width: 220px;
    min-height: 48px;
    padding: 0 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 0;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 7px 18px rgba(159, 18, 57, 0.18);
}

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

.qr-preview {
    min-height: 420px;
    padding: 28px;
    display: grid;
    place-items: center;
    background:
        linear-gradient(45deg, #faf5f7 25%, transparent 25%) 0 0 / 20px 20px,
        linear-gradient(-45deg, #faf5f7 25%, transparent 25%) 0 10px / 20px 20px,
        linear-gradient(45deg, transparent 75%, #faf5f7 75%) 10px -10px / 20px 20px,
        linear-gradient(-45deg, transparent 75%, #faf5f7 75%) -10px 0 / 20px 20px,
        #fff;
}

.qr-preview canvas {
    display: block;
    width: min(100%, 420px);
    height: auto;
    border: 1px solid #ead5dc;
    background: #fff;
    box-shadow: 0 10px 24px rgba(75, 18, 39, 0.08);
}

.qr-preview__empty {
    max-width: 440px;
    padding: 24px;
    color: #9a7d87;
    font-size: 13px;
    line-height: 1.8;
    text-align: center;
}

.utility-message {
    margin: 0 26px 26px;
    padding: 12px 14px;
    border: 1px solid #efb3c2;
    border-radius: 9px;
    background: #fff5f7;
    color: var(--danger);
    font-size: 13px;
}

.utility-message.is-success {
    border-color: #bad7c8;
    background: #f3fbf6;
    color: #246642;
}

.is-hidden {
    display: none !important;
}

.utility-guide {
    margin-top: auto;
    padding: 62px 20px 72px;
    border-top: 1px solid var(--border);
    background: #fff;
}

.utility-guide__inner {
    width: min(1080px, 100%);
    margin: 0 auto;
}

.utility-guide__lead {
    max-width: 760px;
    margin: 0 auto 28px;
    text-align: center;
}

.utility-guide__lead h2 {
    margin: 0;
    color: #3b1020;
    font-size: 25px;
}

.utility-guide__lead p {
    margin: 13px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.9;
}

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

.utility-guide__card,
.utility-guide__notice {
    padding: 21px;
    border: 1px solid var(--border);
    border-radius: 13px;
    background: #fffafb;
}

.utility-guide__card strong,
.utility-guide__notice strong {
    color: #4c1c2c;
    font-size: 14px;
}

.utility-guide__card p,
.utility-guide__notice p {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
    line-height: 1.75;
}

.utility-guide__notice {
    margin-top: 16px;
    background: #fff;
}

.global-nav__row {
    align-items: center;
}

.global-footer__nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-form__submit {
    margin-top: 4px;
}

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

@media (max-width: 760px) {
    .utility-page {
        width: min(100% - 24px, 1180px);
        padding: 34px 0 44px;
    }

    .utility-intro > p {
        font-size: 14px;
    }

    .qr-workspace {
        padding: 15px;
    }

    .utility-panel__header {
        align-items: flex-start;
        flex-direction: column;
        gap: 7px;
    }

    .utility-panel__tools {
        width: 100%;
        justify-content: space-between;
    }

    .utility-textarea {
        min-height: 160px;
    }

    .qr-options {
        grid-template-columns: 1fr;
    }

    .utility-action-row {
        min-height: 76px;
    }

    .utility-primary-button {
        width: 100%;
    }

    .qr-preview {
        min-height: 320px;
        padding: 18px;
    }

    .utility-guide {
        padding: 44px 12px 54px;
    }

    .utility-guide__grid {
        grid-template-columns: 1fr;
    }
}


/* --------------------------------------------------------------------------
   Password generator
   -------------------------------------------------------------------------- */
.password-workspace {
    padding: 26px;
}

.password-settings {
    overflow: hidden;
    border: 1px solid #ead5dc;
    border-radius: 13px;
    background: #fff;
}

.password-settings__header {
    padding: 14px 17px;
    border-bottom: 1px solid #f0dfe4;
    background: #fffafb;
}

.password-settings__header strong {
    display: block;
    color: #4c1c2c;
    font-size: 14px;
}

.password-settings__header span {
    display: block;
    margin-top: 3px;
    color: #9a7d87;
    font-size: 11px;
}

.password-settings__body {
    padding: 20px;
}

.password-length {
    padding: 17px 18px;
    border: 1px solid #f0dfe4;
    border-radius: 11px;
    background: #fffafb;
}

.password-length__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.password-length__label label {
    color: #4c1c2c;
    font-size: 13px;
    font-weight: 800;
}

.password-length__value {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #76515e;
    font-size: 12px;
}

.password-length__value input {
    width: 78px;
    height: 38px;
    padding: 0 10px;
    border: 1px solid #dec6cf;
    border-radius: 8px;
    outline: 0;
    background: #fff;
    color: #4c1c2c;
    font-size: 14px;
    font-weight: 800;
    text-align: right;
}

.password-length__value input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(159, 18, 57, 0.08);
}

.password-length input[type="range"] {
    width: 100%;
    margin: 17px 0 3px;
    accent-color: var(--primary);
}

.password-length__scale {
    display: flex;
    justify-content: space-between;
    color: #b399a2;
    font-size: 10px;
}

.password-character-set {
    margin: 17px 0 0;
    padding: 0;
    border: 0;
}

.password-character-set legend {
    margin-bottom: 9px;
    color: #4c1c2c;
    font-size: 13px;
    font-weight: 800;
}

.password-character-set {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.password-character-set legend {
    grid-column: 1 / -1;
}

.password-check {
    min-width: 0;
    padding: 13px 14px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    border: 1px solid #ead5dc;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
}

.password-check:has(input:checked) {
    border-color: #d6a9b7;
    background: #fffafb;
}

.password-check input {
    margin-top: 3px;
    accent-color: var(--primary);
}

.password-check__body {
    min-width: 0;
    display: grid;
    gap: 5px;
}

.password-check__body strong {
    color: #4c1c2c;
    font-size: 12px;
}

.password-check__body code {
    color: #96727e;
    font-size: 10px;
    overflow-wrap: anywhere;
}

.password-secondary-options {
    margin-top: 17px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    gap: 12px;
}

.password-switch,
.password-select-field {
    min-height: 67px;
    padding: 12px 14px;
    border: 1px solid #ead5dc;
    border-radius: 10px;
    background: #fffafb;
}

.password-switch {
    display: flex;
    align-items: center;
    gap: 11px;
    cursor: pointer;
}

.password-switch input {
    accent-color: var(--primary);
}

.password-switch span {
    display: grid;
    gap: 3px;
}

.password-switch strong,
.password-select-field > span {
    color: #4c1c2c;
    font-size: 12px;
    font-weight: 800;
}

.password-switch small {
    color: #9a7d87;
    font-size: 10px;
}

.password-select-field {
    display: grid;
    align-content: center;
    gap: 7px;
}

.password-select-field select {
    width: 100%;
    height: 35px;
    padding: 0 9px;
    border: 1px solid #dec6cf;
    border-radius: 7px;
    outline: 0;
    background: #fff;
    color: #4c1c2c;
}

.password-result-empty {
    padding: 52px 20px;
    color: #9a7d87;
    font-size: 13px;
    text-align: center;
}

.password-result-list {
    display: grid;
}

.password-result-row {
    min-width: 0;
    padding: 11px 14px;
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #f2e4e8;
}

.password-result-row:last-child {
    border-bottom: 0;
}

.password-result-row:hover {
    background: #fffbfc;
}

.password-result-row__number {
    color: #b0929c;
    font-size: 10px;
    text-align: center;
}

.password-result-row__value {
    min-width: 0;
    color: #332029;
    font: 600 14px/1.55 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    overflow-wrap: anywhere;
    user-select: all;
}

.password-result-row__copy {
    min-height: 31px;
    padding: 0 10px;
    border: 1px solid #d9b9c4;
    border-radius: 7px;
    background: #fff;
    color: var(--primary);
    cursor: pointer;
    font-size: 11px;
    font-weight: 800;
}

.password-result-row__copy:hover {
    background: #fff1f2;
}

.password-strength {
    padding: 15px 16px 17px;
    border-top: 1px solid #f0dfe4;
    background: #fffafb;
}

.password-strength__label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    color: #76515e;
    font-size: 11px;
}

.password-strength__label strong {
    color: #4c1c2c;
    font-size: 12px;
}

.password-strength__track {
    height: 7px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #eddfe4;
}

.password-strength__track span {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: #b4234c;
    transition: width .18s ease;
}

.password-strength[data-level="weak"] .password-strength__track span {
    opacity: .55;
}

.password-strength[data-level="fair"] .password-strength__track span {
    opacity: .7;
}

.password-strength[data-level="strong"] .password-strength__track span {
    opacity: .85;
}

.password-strength[data-level="very-strong"] .password-strength__track span {
    opacity: 1;
}

.password-strength p {
    margin: 8px 0 0;
    color: #96727e;
    font-size: 10px;
    line-height: 1.65;
}

@media (max-width: 980px) {
    .password-character-set {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .password-workspace {
        padding: 15px;
    }

    .password-settings__body {
        padding: 14px;
    }

    .password-character-set {
        grid-template-columns: 1fr;
    }

    .password-secondary-options {
        grid-template-columns: 1fr;
    }

    .password-result-row {
        grid-template-columns: 22px minmax(0, 1fr);
    }

    .password-result-row__copy {
        grid-column: 2;
        width: fit-content;
    }
}


.password-check--symbols {
    grid-column: 1 / -1;
}

.password-symbol-options {
    margin-top: 17px;
    overflow: hidden;
    border: 1px solid #ead5dc;
    border-radius: 11px;
    background: #fff;
}

.password-symbol-options.is-disabled {
    opacity: .55;
    background: #faf7f8;
}

.password-symbol-options__header {
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-bottom: 1px solid #f0dfe4;
    background: #fffafb;
}

.password-symbol-options__header strong {
    display: block;
    color: #4c1c2c;
    font-size: 12px;
}

.password-symbol-options__header span {
    display: block;
    margin-top: 3px;
    color: #9a7d87;
    font-size: 10px;
}

.password-symbol-options__actions {
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}

.password-symbol-options__actions .text-button:disabled {
    cursor: default;
    color: #c9b5bc;
    background: transparent;
}

.password-symbol-grid {
    padding: 14px;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 8px;
}

.password-symbol-item {
    min-width: 0;
    min-height: 42px;
    display: grid;
    place-items: center;
    position: relative;
    border: 1px solid #ead5dc;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
}

.password-symbol-item:has(input:checked) {
    border-color: #c9899d;
    background: #fff5f7;
    box-shadow: inset 0 0 0 1px rgba(159, 18, 57, .05);
}

.password-symbol-item:has(input:disabled) {
    cursor: default;
}

.password-symbol-item input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.password-symbol-item code {
    color: #4c1c2c;
    font: 700 15px/1 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

@media (max-width: 980px) {
    .password-symbol-grid {
        grid-template-columns: repeat(8, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .password-symbol-options__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .password-symbol-options__actions {
        width: 100%;
        justify-content: flex-end;
    }

    .password-symbol-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

@media (max-width: 420px) {
    .password-symbol-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}


/* --------------------------------------------------------------------------
   Gregorian / Japanese era converter
   -------------------------------------------------------------------------- */
.wareki-workspace {
    padding: 26px;
}

.utility-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    padding: 5px;
    border: 1px solid #ead5dc;
    border-radius: 11px;
    background: #fffafb;
}

.utility-tab {
    min-height: 42px;
    flex: 1;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #8d6a76;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.utility-tab:hover {
    background: #fff;
    color: var(--primary);
}

.utility-tab.is-active {
    background: #fff;
    color: var(--primary);
    box-shadow: 0 2px 10px rgba(75, 18, 39, .08);
}

.wareki-panel[hidden] {
    display: none !important;
}

.wareki-input-card {
    overflow: hidden;
    border: 1px solid #ead5dc;
    border-radius: 13px;
    background: #fff;
}

.wareki-input-card__header {
    min-height: 62px;
    padding: 12px 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid #f0dfe4;
    background: #fffafb;
}

.wareki-input-card__header strong {
    display: block;
    color: #4c1c2c;
    font-size: 14px;
}

.wareki-input-card__header span {
    display: block;
    margin-top: 3px;
    color: #9a7d87;
    font-size: 11px;
}

.wareki-date-row,
.wareki-japanese-inputs {
    padding: 20px;
}

.wareki-date-row {
    display: grid;
    grid-template-columns: minmax(260px, 440px);
}

.wareki-japanese-inputs {
    display: grid;
    grid-template-columns: 1.2fr repeat(3, minmax(120px, .8fr));
    gap: 12px;
}

.wareki-field {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 7px;
}

.wareki-field > span:first-child {
    color: #4c1c2c;
    font-size: 12px;
    font-weight: 800;
}

.wareki-field input,
.wareki-field select {
    width: 100%;
    height: 42px;
    padding: 0 11px;
    border: 1px solid #dec6cf;
    border-radius: 8px;
    outline: 0;
    background: #fff;
    color: #4c1c2c;
    font-size: 14px;
}

.wareki-field input:focus,
.wareki-field select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(159, 18, 57, .08);
}

.wareki-number-input {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    margin: 0 !important;
    color: #76515e;
}

.wareki-number-input small {
    font-size: 11px;
}

.wareki-era-range {
    margin: 0;
    padding: 0 20px 18px;
    color: #96727e;
    font-size: 11px;
    line-height: 1.7;
}

.wareki-result-empty {
    padding: 58px 20px;
    color: #9a7d87;
    font-size: 13px;
    text-align: center;
}

.wareki-result {
    padding: 22px;
}

.wareki-result__primary {
    padding: 21px;
    display: grid;
    gap: 7px;
    border: 1px solid #e7ccd5;
    border-radius: 11px;
    background: #fffafb;
    text-align: center;
}

.wareki-result__primary span {
    color: #987681;
    font-size: 11px;
    font-weight: 800;
}

.wareki-result__primary strong {
    color: #4c1c2c;
    font-size: clamp(23px, 4vw, 34px);
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wareki-result__details {
    margin: 14px 0 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.wareki-result__details > div {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid #ead5dc;
    border-radius: 9px;
    background: #fff;
}

.wareki-result__details dt {
    color: #9a7d87;
    font-size: 10px;
    font-weight: 800;
}

.wareki-result__details dd {
    margin: 5px 0 0;
    color: #4c1c2c;
    font-size: 13px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

@media (max-width: 860px) {
    .wareki-japanese-inputs {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .wareki-workspace {
        padding: 15px;
    }

    .utility-tabs {
        gap: 4px;
    }

    .utility-tab {
        padding: 0 9px;
        font-size: 12px;
    }

    .wareki-input-card__header {
        align-items: flex-start;
        flex-direction: column;
    }

    .wareki-date-row,
    .wareki-japanese-inputs {
        padding: 14px;
    }

    .wareki-date-row,
    .wareki-japanese-inputs {
        grid-template-columns: 1fr;
    }

    .wareki-era-range {
        padding: 0 14px 14px;
    }

    .wareki-result {
        padding: 14px;
    }

    .wareki-result__details {
        grid-template-columns: 1fr;
    }
}
