/* Freewrite — distraction-free writing pad */
.fw-main {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 20px;
}

.fw-intro h2 {
    font-size: 14pt;
    font-weight: normal;
    margin: 0 0 8px 0;
}

.fw-intro p {
    color: #444444;
    line-height: 1.7;
    margin: 0 0 22px 0;
}

/* The writing unit: toolbar + textarea + footer, all in one box.
   This whole box is what goes full screen. */
.fw-pad {
    display: flex;
    flex-direction: column;
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    background-color: #ffffff;
    overflow: hidden;
}

/* Toolbar lives inside the box, above the writing surface */
.fw-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 10px;
    border-bottom: 1px solid #eeeeee;
    background-color: #fafafa;
}

.fw-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

/* Buttons */
.fw-btn,
.fw-seg button {
    font-family: inherit;
    font-size: 9pt;
    color: #000000;
    background-color: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 4px;
    padding: 4px 11px;
    cursor: pointer;
}

.fw-btn:hover,
.fw-seg button:hover { border-color: #000000; }

/* Segmented groups (durations / fonts / sizes) */
.fw-seg {
    display: inline-flex;
    border: 1px solid #cccccc;
    border-radius: 4px;
    overflow: hidden;
}

.fw-seg button {
    border: none;
    border-right: 1px solid #e2e2e2;
    border-radius: 0;
}

.fw-seg button:last-child { border-right: none; }

.fw-seg button.active {
    background-color: #000000;
    color: #ffffff;
}

.fw-timer {
    font-variant-numeric: tabular-nums;
    font-size: 13pt;
    color: #000000;
    min-width: 56px;
    text-align: center;
}

.fw-nudge {
    color: #b08900;
    font-size: 9pt;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.fw-nudge.show { opacity: 1; }

.fw-stop { display: none; }

/* The writing surface fills the rest of the box */
.fw-text {
    display: block;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    min-height: 54vh;
    resize: none;
    border: none;
    padding: 24px 26px;
    line-height: 1.75;
    color: #1a1a1a;
    background-color: #ffffff;
    outline: none;
}

/* Typeface options */
.fw-text.font-serif { font-family: Georgia, 'Iowan Old Style', 'Palatino Linotype', Palatino, serif; }
.fw-text.font-sans  { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; }
.fw-text.font-mono  { font-family: ui-monospace, 'SF Mono', Menlo, Consolas, 'Liberation Mono', monospace; }

/* Size options */
.fw-text.size-s { font-size: 1.05rem; }
.fw-text.size-m { font-size: 1.25rem; }
.fw-text.size-l { font-size: 1.55rem; }

/* Footer inside the box */
.fw-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px;
    padding: 8px 12px;
    border-top: 1px solid #eeeeee;
    background-color: #fafafa;
    min-height: 28px;
}

.fw-count { color: #666666; font-size: 9pt; }

.fw-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    visibility: hidden;
}

.fw-done-msg {
    color: #216e39;
    font-size: 9pt;
    margin-right: 6px;
}

.fw-note {
    margin-top: 18px;
    font-size: 9pt;
    color: #999999;
}

/* Running mode: fade the page chrome so the box is all there is */
body.fw-running .fw-intro,
body.fw-running .fw-note,
body.fw-running header,
body.fw-running footer {
    opacity: 0.12;
    transition: opacity 0.5s ease;
}
body.fw-running .fw-intro:hover,
body.fw-running header:hover,
body.fw-running footer:hover { opacity: 1; }

/* While running, swap Start for Stop and hide duration picking */
body.fw-running #fwTimes,
body.fw-running .fw-start { display: none; }
body.fw-running .fw-stop { display: inline-block; }

/* Show the finish actions once a session ends */
body.fw-done .fw-actions { visibility: visible; }

/* Full screen: the whole box fills the screen, textarea fills the box */
.fw-pad:fullscreen,
.fw-pad:-webkit-full-screen {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0;
}
.fw-pad:fullscreen .fw-text,
.fw-pad:-webkit-full-screen .fw-text {
    min-height: 0;
}
