/* =========================================================
   TOWNTUNE V3 GENERATORS / PLANNERS
   ========================================================= */

html.tt-tool-open,
html.tt-tool-open body,
body.tt-tool-open {
    overflow: hidden !important;
}

.generator-page-main {
    width: min(1180px, calc(100% - 28px));
    margin: 24px auto 70px;
}

.generator-launch-card {
    position: relative;
    min-height: 390px;
    display: grid;
    grid-template-columns: minmax(0, 1.10fr) minmax(300px, .90fr);
    align-items: stretch;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 32px;
    background:
        radial-gradient(circle at 13% 15%, rgba(107, 224, 211, .14), transparent 27%),
        radial-gradient(circle at 90% 9%, rgba(118, 94, 245, .21), transparent 31%),
        linear-gradient(135deg, #112742, #171d4d 58%, #26395a);
    box-shadow: 0 24px 58px rgba(0,0,0,.25);
    cursor: pointer;
    outline: none;
}

.generator-launch-card:focus-visible {
    box-shadow:
        0 0 0 3px rgba(112,224,211,.48),
        0 24px 58px rgba(0,0,0,.25);
}

.generator-launch-art {
    position: relative;
    min-height: 320px;
    display: grid;
    place-items: center;
    overflow: hidden;
    padding: 34px;
}

.generator-launch-art::before,
.generator-launch-art::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
}

.generator-launch-art::before {
    width: 290px;
    height: 290px;
    left: -100px;
    bottom: -130px;
    background: rgba(255,255,255,.05);
}

.generator-launch-art::after {
    width: 220px;
    height: 220px;
    right: -100px;
    top: -95px;
    background: rgba(255,255,255,.05);
}

.generator-launch-copy {
    position: relative;
    z-index: 2;
    display: grid;
    align-content: center;
    gap: 26px;
    padding: clamp(30px, 5vw, 54px);
    background: rgba(4,14,30,.20);
    backdrop-filter: blur(10px);
}

.generator-launch-kicker {
    color: #73e0d5;
    font-size: 11px;
    font-weight: 950;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.generator-launch-copy h1 {
    margin: 8px 0 12px;
    color: #fff;
    font-size: clamp(42px, 5vw, 67px);
    line-height: .95;
    letter-spacing: -2.8px;
}

.generator-launch-copy p {
    max-width: 530px;
    margin: 0;
    color: #bac9da;
    font-size: 16px;
    line-height: 1.6;
    font-weight: 650;
}

.generator-launch-button {
    width: fit-content;
    min-height: 52px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0 20px;
    border: 0;
    border-radius: 15px;
    background: linear-gradient(135deg, #6ce0d3, #68a7ff);
    color: #07172c;
    font: inherit;
    font-size: 15px;
    font-weight: 950;
    box-shadow: 0 14px 28px rgba(54,176,191,.22);
    cursor: pointer;
}

.generator-landing-section {
    margin-top: 56px;
}

.generator-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 20px;
    margin-bottom: 18px;
}

.generator-section-heading h2 {
    margin: 5px 0 0;
    color: #fff;
    font-size: clamp(28px, 3vw, 38px);
}

.generator-section-link {
    color: #73e0d5 !important;
    font-size: 13px;
    font-weight: 900;
    text-decoration: none;
}

.related-tool-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
}

.related-tool-grid > [hidden] {
    display: none !important;
}

.generator-tool-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 20px;
    background: rgba(255,255,255,.055);
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(0,0,0,.14);
    transition: transform .18s ease, border-color .18s ease;
}

.generator-tool-card:hover {
    transform: translateY(-4px);
    border-color: rgba(115,224,213,.24);
}

.generator-tool-art {
    position: relative;
    min-height: 150px;
    display: grid;
    place-items: center;
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 10%, rgba(255,255,255,.10), transparent 40%),
        linear-gradient(135deg, #263c67, #4c3e8d);
}

.generator-tool-art span:first-child {
    font-size: 50px;
}

.generator-tool-badge {
    position: absolute;
    right: 10px;
    top: 10px;
    padding: 6px 8px;
    border-radius: 999px;
    background: rgba(5,18,35,.64);
    color: #dce8f4;
    font-size: 9px !important;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.generator-tool-meta {
    padding: 14px;
}

.generator-tool-meta h3 {
    margin: 0 0 6px;
    color: #fff;
    font-size: 15px;
}

.generator-tool-meta p {
    margin: 0;
    color: #9eb0c4;
    font-size: 12px;
    line-height: 1.45;
}

.generator-info-panel {
    padding: clamp(26px, 4vw, 44px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 26px;
    background: #eef3f8;
    color: #12243a;
    box-shadow: 0 18px 42px rgba(0,0,0,.18);
}

.generator-info-panel .about-label {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    background: #dce6f2;
    color: #31506d;
    font-size: 10px;
    font-weight: 950;
    letter-spacing: .10em;
    text-transform: uppercase;
}

.generator-info-panel h2 {
    margin: 12px 0 14px;
    color: #0b2036;
    font-size: clamp(30px, 4vw, 46px);
    letter-spacing: -1.5px;
}

.generator-info-panel h3 {
    margin: 25px 0 8px;
    color: #122b45;
    font-size: 20px;
}

.generator-info-panel p,
.generator-info-panel li {
    color: #4a6177;
    font-size: 15px;
    line-height: 1.65;
}

.generator-info-panel ul {
    padding-left: 20px;
}

.generator-info-links {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 28px;
}

body.portal-v2 .generator-info-panel .generator-info-links a,
body.portal-v2 .generator-info-panel .generator-info-links a:visited {
    display: inline-flex;
    min-height: 40px;
    align-items: center;
    padding: 9px 13px;
    border-radius: 11px;
    background: #103250;
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}


/* =========================================================
   LANDING ART
   ========================================================= */

.tool-launch-demo {
    position: relative;
    z-index: 2;
    width: min(100%, 580px);
    min-height: 245px;
}

.story-launch-demo {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 11px;
    align-content: center;
}

.story-launch-demo span {
    min-height: 106px;
    display: grid;
    place-items: center;
    padding: 10px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 22px;
    background: rgba(255,255,255,.09);
    color: #fff;
    font-size: 42px;
    box-shadow: 0 14px 30px rgba(0,0,0,.16);
}

.story-launch-demo b {
    grid-column: 1 / -1;
    color: #fff;
    font-size: 24px;
    text-align: center;
}

.screenfree-launch-demo {
    display: grid;
    place-items: center;
}

.screenfree-launch-demo .phone-off {
    width: 170px;
    height: 170px;
    display: grid;
    place-items: center;
    border: 8px solid rgba(255,255,255,.88);
    border-radius: 36px;
    background: linear-gradient(135deg, #4f62df, #8f50c7);
    color: #fff;
    font-size: 70px;
    box-shadow: 0 18px 36px rgba(0,0,0,.22);
    transform: rotate(-6deg);
}

.screenfree-launch-demo .activity-orbits {
    position: absolute;
    inset: 0;
}

.screenfree-launch-demo .activity-orbits span {
    position: absolute;
    width: 64px;
    height: 64px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255,255,255,.11);
    font-size: 31px;
}

.screenfree-launch-demo .activity-orbits span:nth-child(1) { left: 10%; top: 15%; }
.screenfree-launch-demo .activity-orbits span:nth-child(2) { right: 10%; top: 12%; }
.screenfree-launch-demo .activity-orbits span:nth-child(3) { left: 16%; bottom: 8%; }
.screenfree-launch-demo .activity-orbits span:nth-child(4) { right: 14%; bottom: 9%; }

.hunt-launch-demo {
    display: grid;
    place-items: center;
}

.hunt-launch-map {
    width: min(420px, 90%);
    min-height: 220px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255,255,255,.10), rgba(255,255,255,.04)),
        repeating-linear-gradient(45deg, rgba(255,255,255,.04) 0 12px, transparent 12px 24px);
    color: #fff;
    font-size: 70px;
    box-shadow: 0 16px 34px rgba(0,0,0,.20);
    transform: rotate(-2deg);
}

.rainy-launch-demo {
    display: grid;
    place-items: center;
}

.rainy-launch-demo .rain-cloud {
    font-size: 108px;
    filter: drop-shadow(0 16px 24px rgba(0,0,0,.18));
}

.rainy-launch-demo .rainy-icons {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.rainy-launch-demo .rainy-icons span {
    width: 66px;
    height: 66px;
    display: grid;
    place-items: center;
    border-radius: 18px;
    background: rgba(255,255,255,.09);
    font-size: 32px;
}

.tracing-launch-demo {
    display: grid;
    place-items: center;
}

.tracing-launch-paper {
    width: min(430px, 92%);
    padding: 28px 24px;
    border-radius: 20px;
    background: #fff;
    color: #63728a;
    box-shadow: 0 18px 36px rgba(0,0,0,.24);
    transform: rotate(-2deg);
}

.tracing-launch-paper strong {
    display: block;
    margin-bottom: 16px;
    color: #1b3450;
    font-size: 22px;
}

.tracing-launch-name {
    padding-bottom: 9px;
    border-bottom: 3px solid #b9c7d8;
    color: #aeb6bf;
    font-size: 46px;
    font-weight: 950;
    letter-spacing: 3px;
    text-align: center;
    text-shadow:
        1px 0 0 #fff,
        -1px 0 0 #fff;
}

.routine-launch-demo {
    display: grid;
    place-items: center;
}

.routine-launch-list {
    width: min(440px, 92%);
    display: grid;
    gap: 10px;
    padding: 22px;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 18px 36px rgba(0,0,0,.23);
    transform: rotate(1.5deg);
}

.routine-launch-list span {
    min-height: 50px;
    display: grid;
    grid-template-columns: 34px 1fr;
    align-items: center;
    gap: 10px;
    padding: 7px 11px;
    border-radius: 12px;
    background: #eef3f8;
    color: #17324e;
    font-size: 13px;
    font-weight: 900;
}

.routine-launch-list span::before {
    content: "✓";
    width: 27px;
    height: 27px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: #6dddcf;
    color: #082237;
}


/* =========================================================
   FULLSCREEN TOOL SHELL
   ========================================================= */

.tt-tool-player {
    position: fixed;
    z-index: 7000;
    inset: 0;
    height: 100dvh;
    display: none;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    background:
        radial-gradient(circle at 50% 0%, rgba(49,91,126,.20), transparent 33%),
        #061524;
}

.tt-tool-player.open {
    display: grid;
}

.tt-tool-topbar {
    position: relative;
    z-index: 5;
    min-height: calc(58px + env(safe-area-inset-top));
    padding:
        env(safe-area-inset-top)
        max(10px, env(safe-area-inset-right))
        0
        max(10px, env(safe-area-inset-left));
    display: grid;
    grid-template-columns: 74px minmax(0, 1fr) 74px;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid rgba(255,255,255,.07);
    background: rgba(7,23,44,.96);
    backdrop-filter: blur(14px);
}

.tt-tool-exit {
    width: 68px;
    min-height: 42px;
    padding: 0 9px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 14px;
    background: rgba(255,255,255,.07);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 950;
    cursor: pointer;
}

.tt-tool-title {
    min-width: 0;
    overflow: hidden;
    color: #fff;
    font-size: clamp(17px, 2.4dvh, 22px);
    font-weight: 950;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tt-tool-spacer {
    width: 68px;
}

.tt-tool-inner {
    min-height: 0;
    width: min(100%, 1100px);
    margin: 0 auto;
    padding:
        clamp(6px, 1.2dvh, 11px)
        max(6px, env(safe-area-inset-right))
        max(6px, env(safe-area-inset-bottom))
        max(6px, env(safe-area-inset-left));
    overflow: hidden;
}

.tt-tool-app {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: clamp(18px, 2.6dvh, 28px);
    background:
        radial-gradient(circle at 80% 0%, rgba(96,164,255,.10), transparent 28%),
        #102d4e;
    box-shadow: 0 20px 50px rgba(0,0,0,.30);
}

.tool-app-head {
    padding: clamp(8px, 1.4dvh, 14px);
    border-bottom: 1px solid rgba(255,255,255,.07);
}

.tool-chip-row {
    display: flex;
    justify-content: center;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
}

.tool-chip-row::-webkit-scrollbar {
    display: none;
}

.tool-chip {
    flex: 0 0 auto;
    min-height: clamp(32px, 4.6dvh, 39px);
    padding: 6px 11px;
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 11px;
    background: rgba(255,255,255,.055);
    color: #d6e2ef;
    font: inherit;
    font-size: clamp(10px, 1.55dvh, 12px);
    font-weight: 850;
    cursor: pointer;
}

.tool-chip.active {
    border-color: rgba(108,224,211,.38);
    background: rgba(108,224,211,.15);
    color: #fff;
}

.tool-app-stage {
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: clamp(5px, 1dvh, 10px);
    overflow: hidden;
    padding:
        clamp(8px, 1.4dvh, 14px)
        clamp(10px, 2vw, 20px)
        clamp(9px, 1.5dvh, 15px);
}

.tool-prompt {
    margin: 0;
    color: #a9bdd1;
    font-size: clamp(11px, 1.8dvh, 14px);
    line-height: 1.35;
    font-weight: 850;
    text-align: center;
}

.generator-output-v3 {
    width: min(100%, 800px);
    min-height: clamp(160px, 31dvh, 270px);
    display: grid;
    place-items: center;
    padding: clamp(18px, 3.5dvh, 32px);
    border: 1px solid rgba(255,255,255,.10);
    border-radius: clamp(18px, 3dvh, 27px);
    background:
        radial-gradient(circle at 50% 0%, rgba(255,255,255,.08), transparent 45%),
        rgba(255,255,255,.065);
    color: #fff;
    font-size: clamp(20px, 3.8dvh, 34px);
    line-height: 1.35;
    font-weight: 950;
    text-align: center;
    box-shadow: 0 14px 32px rgba(0,0,0,.14);
}

.tool-action-row {
    width: min(100%, 800px);
    display: flex;
    justify-content: center;
    gap: 7px;
}

.tool-action {
    min-width: 130px;
    min-height: clamp(38px, 5.6dvh, 46px);
    padding: 7px 14px;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    background: rgba(255,255,255,.07);
    color: #fff;
    font: inherit;
    font-size: clamp(11px, 1.7dvh, 13px);
    font-weight: 900;
    cursor: pointer;
}

.tool-action.primary {
    border-color: transparent;
    background: linear-gradient(135deg, #6374ff, #795be0);
}

.tool-action.accent {
    border-color: transparent;
    background: linear-gradient(135deg, #42c7b5, #3196c7);
}

.tool-message {
    min-height: 20px;
    color: #8fabc3;
    font-size: 11px;
    font-weight: 800;
    text-align: center;
}


/* =========================================================
   SCREEN-FREE RESULT
   ========================================================= */

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

.tool-field {
    display: grid;
    gap: 4px;
}

.tool-field label {
    color: #aebfd1;
    font-size: 10px;
    font-weight: 850;
}

.tool-field select,
.tool-field input {
    width: 100%;
    min-width: 0;
    min-height: 38px;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 10px;
    background: rgba(255,255,255,.07);
    color: #fff;
    padding: 7px 9px;
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    outline: none;
}

.tool-field select {
    color-scheme: dark;
}

.activity-result-v3 {
    width: min(100%, 840px);
    max-height: 100%;
    overflow: auto;
    padding: clamp(14px, 2.3dvh, 22px);
    border: 1px solid rgba(255,255,255,.09);
    border-radius: 22px;
    background: rgba(255,255,255,.06);
    color: #fff;
    scrollbar-width: thin;
}

.activity-result-icon {
    font-size: clamp(42px, 8dvh, 67px);
    text-align: center;
}

.activity-result-v3 h2 {
    margin: 5px 0 7px;
    color: #fff;
    font-size: clamp(23px, 4dvh, 34px);
    text-align: center;
}

.activity-result-description {
    max-width: 720px;
    margin: 0 auto;
    color: #c1d0df;
    font-size: clamp(12px, 1.9dvh, 15px);
    line-height: 1.5;
    text-align: center;
}

.activity-result-tags {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.activity-result-tags span {
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(255,255,255,.075);
    color: #dce8f5;
    font-size: 10px;
    font-weight: 850;
}

.activity-result-steps {
    max-width: 720px;
    margin: 10px auto 0;
    padding: 13px 16px;
    border-radius: 15px;
    background: rgba(5,21,39,.33);
}

.activity-result-steps h3 {
    margin: 0 0 7px;
    color: #fff;
    font-size: 13px;
    text-align: center;
}

.activity-result-steps ol {
    margin: 0;
    padding-left: 22px;
    color: #c6d4e3;
    font-size: 11px;
    line-height: 1.45;
}

.activity-result-steps li {
    margin: 4px 0;
}


/* =========================================================
   NAME TRACING WORKSHEET
   ========================================================= */

.tracing-tool-head {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: end;
    gap: 10px;
}

.tracing-head-actions {
    display: flex;
    gap: 5px;
}

.paper-stage-v3 {
    min-height: 0;
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    overflow: auto;
    padding: 5px;
}

.name-tracing-paper {
    width: min(760px, 96%);
    min-height: min(680px, calc(100dvh - 150px));
    box-sizing: border-box;
    padding: clamp(20px, 3.8dvh, 34px);
    border: 4px solid #7865e2;
    border-radius: 20px;
    background: #fff;
    color: #263747;
    box-shadow: 0 17px 38px rgba(0,0,0,.27);
}

.name-tracing-paper h2 {
    margin: 0;
    color: #5947bf;
    font-size: clamp(25px, 4.4dvh, 37px);
    text-align: center;
}

.tracing-subheading {
    margin: 6px 0 clamp(14px, 2.8dvh, 24px);
    color: #6a7580;
    font-size: clamp(11px, 1.7dvh, 14px);
    font-weight: 750;
    text-align: center;
}

.tracing-practice-line {
    position: relative;
    min-height: clamp(62px, 10dvh, 88px);
    display: flex;
    align-items: end;
    justify-content: center;
    margin: clamp(7px, 1.2dvh, 11px) 0;
    border-bottom: 2px solid #8c99a8;
}

.tracing-practice-line::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    border-top: 1px dashed #d0d6dd;
}

.tracing-name {
    position: relative;
    z-index: 2;
    padding-bottom: 6px;
    color: #a7adb5;
    font-size: clamp(34px, 6.1dvh, 52px);
    line-height: 1;
    font-weight: 900;
    letter-spacing: 1.5px;
    opacity: .55;
}

.tracing-practice-line.blank .tracing-name {
    visibility: hidden;
}

.tracing-footer {
    margin-top: 15px;
    color: #6e7a85;
    font-size: 12px;
    font-weight: 850;
    text-align: center;
}


/* =========================================================
   MORNING ROUTINE
   ========================================================= */

.routine-builder-layout {
    min-height: 0;
    width: 100%;
    height: 100%;
    display: grid;
    grid-template-columns: minmax(300px, .9fr) minmax(360px, 1.1fr);
    gap: 10px;
}

.routine-editor-v3,
.routine-preview-panel-v3 {
    min-height: 0;
    overflow: auto;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 18px;
    background: rgba(255,255,255,.05);
    padding: 12px;
    scrollbar-width: thin;
}

.routine-editor-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.routine-rows-v3 {
    display: grid;
    gap: 6px;
}

.routine-edit-row {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr) 86px;
    gap: 6px;
    align-items: center;
}

.routine-edit-number {
    width: 32px;
    height: 32px;
    display: grid;
    place-items: center;
    border-radius: 9px;
    background: rgba(255,255,255,.08);
    color: #cfe0f0;
    font-size: 11px;
    font-weight: 900;
}

.routine-edit-row input {
    min-width: 0;
    min-height: 36px;
    border: 1px solid rgba(255,255,255,.10);
    border-radius: 9px;
    background: rgba(255,255,255,.065);
    color: #fff;
    padding: 6px 8px;
    font: inherit;
    font-size: 11px;
    outline: none;
}

.routine-editor-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 10px;
}

.routine-editor-actions .tool-action {
    min-width: 0;
    flex: 1 1 120px;
}

.morning-routine-paper {
    min-height: 100%;
    box-sizing: border-box;
    padding: clamp(18px, 2.8dvh, 26px);
    border: 3px solid #7865e2;
    border-radius: 17px;
    background: #fff;
    color: #263747;
}

.morning-routine-paper h2 {
    margin: 0;
    color: #5947bf;
    font-size: clamp(23px, 3.5dvh, 32px);
    text-align: center;
}

.routine-paper-subtitle {
    margin: 6px 0 13px;
    color: #6d7781;
    font-size: 12px;
    font-weight: 750;
    text-align: center;
}

.routine-preview-list {
    display: grid;
    gap: 7px;
}

.routine-preview-item {
    display: grid;
    grid-template-columns: 35px minmax(0,1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 8px 10px;
    border-radius: 11px;
    background: #eef3f8;
}

.routine-preview-check {
    width: 31px;
    height: 31px;
    display: grid;
    place-items: center;
    border: 2px solid #8f9eac;
    border-radius: 9px;
    background: #fff;
    color: transparent;
    cursor: pointer;
}

.routine-preview-check.done {
    border-color: #39af83;
    background: #55d0a4;
    color: #fff;
}

.routine-preview-check.done::before {
    content: "✓";
    font-weight: 950;
}

.routine-preview-task {
    min-width: 0;
    color: #253b50;
    font-size: 13px;
    font-weight: 850;
}

.routine-preview-time {
    color: #64778a;
    font-size: 11px;
    font-weight: 850;
}

.routine-preview-message {
    margin-top: 12px;
    padding: 10px;
    border-radius: 10px;
    background: #f2efff;
    color: #5947bf;
    font-size: 13px;
    font-weight: 900;
    text-align: center;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {
    .generator-launch-card {
        grid-template-columns: 1fr;
    }

    .generator-launch-art {
        min-height: 275px;
    }

    .generator-launch-copy {
        padding: 28px 24px;
    }

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

    .routine-builder-layout {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(180px, .95fr) minmax(220px, 1.05fr);
    }
}

@media (max-width: 600px) {
    .generator-page-main {
        width: min(100% - 18px, 1180px);
        margin-top: 14px;
    }

    .generator-launch-card {
        min-height: 0;
        border-radius: 23px;
    }

    .generator-launch-art {
        min-height: 220px;
        padding: 18px;
    }

    .tool-launch-demo {
        min-height: 185px;
    }

    .generator-launch-copy h1 {
        font-size: 44px;
        letter-spacing: -2px;
    }

    .generator-launch-copy p {
        font-size: 14px;
    }

    .related-tool-grid {
        gap: 10px;
    }

    .tt-tool-topbar {
        min-height: calc(52px + env(safe-area-inset-top));
        grid-template-columns: 62px minmax(0,1fr) 62px;
        padding-left: max(6px, env(safe-area-inset-left));
        padding-right: max(6px, env(safe-area-inset-right));
    }

    .tt-tool-exit {
        width: 58px;
        min-height: 38px;
        border-radius: 12px;
        font-size: 11px;
    }

    .tt-tool-title {
        font-size: 15px;
    }

    .tt-tool-spacer {
        width: 58px;
    }

    .tt-tool-inner {
        padding: 5px max(4px, env(safe-area-inset-right))
            max(4px, env(safe-area-inset-bottom))
            max(4px, env(safe-area-inset-left));
    }

    .tt-tool-app {
        border-radius: 17px;
    }

    .tool-app-head {
        padding: 6px;
    }

    .tool-chip-row {
        justify-content: flex-start;
    }

    .tool-app-stage {
        padding: 6px 7px 7px;
        gap: 4px;
    }

    .generator-output-v3 {
        min-height: clamp(130px, 26dvh, 210px);
        padding: 15px;
        border-radius: 16px;
        font-size: clamp(18px, 3.1dvh, 26px);
    }

    .tool-action {
        min-width: 0;
        flex: 1 1 0;
    }

    .tool-filter-grid {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 5px;
    }

    .tool-field label {
        font-size: 8px;
    }

    .tool-field select,
    .tool-field input {
        min-height: 34px;
        padding: 5px 6px;
        font-size: 10px;
    }

    .activity-result-v3 {
        padding: 11px;
        border-radius: 15px;
    }

    .activity-result-icon {
        font-size: 42px;
    }

    .activity-result-v3 h2 {
        font-size: 22px;
    }

    .activity-result-steps {
        padding: 9px 12px;
    }

    .tracing-tool-head {
        grid-template-columns: minmax(0,1fr) auto;
        gap: 6px;
    }

    .tracing-head-actions {
        gap: 3px;
    }

    .tracing-head-actions .tool-chip {
        padding-inline: 8px;
    }

    .name-tracing-paper {
        width: 98%;
        min-height: 0;
        padding: 15px;
        border-width: 3px;
        border-radius: 13px;
    }

    .tracing-practice-line {
        min-height: clamp(52px, 9.1dvh, 69px);
        margin: 5px 0;
    }

    .tracing-name {
        font-size: clamp(29px, 5.3dvh, 39px);
    }

    .routine-editor-grid {
        grid-template-columns: 1fr;
    }

    .routine-edit-row {
        grid-template-columns: 30px minmax(0,1fr) 72px;
        gap: 4px;
    }

    .routine-edit-number {
        width: 29px;
        height: 29px;
    }

    .routine-edit-row input {
        min-height: 32px;
        padding: 4px 6px;
        font-size: 10px;
    }

    .routine-preview-item {
        grid-template-columns: 30px minmax(0,1fr);
    }

    .routine-preview-time {
        grid-column: 2;
    }
}

@media (max-height: 650px) {
    .tt-tool-topbar {
        min-height: 46px;
    }

    .tool-app-head {
        padding: 5px 7px;
    }

    .tool-chip {
        min-height: 28px;
        padding: 4px 8px;
        font-size: 9px;
    }

    .tool-app-stage {
        padding: 4px 7px 5px;
        gap: 3px;
    }

    .generator-output-v3 {
        min-height: 115px;
        font-size: clamp(17px, 4dvh, 26px);
    }

    .tool-action {
        min-height: 31px;
    }

    .name-tracing-paper {
        padding: 12px 18px;
    }

    .tracing-practice-line {
        min-height: 44px;
        margin: 4px 0;
    }

    .tracing-name {
        font-size: 30px;
    }
}


/* =========================================================
   PRINT
   ========================================================= */

@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }

    body {
        margin: 0 !important;
        padding: 0 !important;
        background: #fff !important;
    }

    body * {
        visibility: hidden !important;
    }

    .name-tracing-paper.print-target,
    .name-tracing-paper.print-target *,
    .morning-routine-paper.print-target,
    .morning-routine-paper.print-target * {
        visibility: visible !important;
    }

    .name-tracing-paper.print-target,
    .morning-routine-paper.print-target {
        position: absolute !important;
        inset: 0 auto auto 0 !important;
        width: 100% !important;
        min-height: 0 !important;
        box-sizing: border-box !important;
        margin: 0 !important;
        box-shadow: none !important;
        border: 3px solid #7865e2 !important;
        border-radius: 0 !important;
        transform: none !important;
    }

    .name-tracing-paper.print-target {
        padding: 25px !important;
    }

    .morning-routine-paper.print-target {
        padding: 18px !important;
    }

    .tracing-practice-line {
        min-height: 90px !important;
    }
}
