:root {
    color-scheme: light;
    --desktop: #008080;
    --face: #c0c0c0;
    --light: #ffffff;
    --midlight: #dfdfdf;
    --shadow: #808080;
    --dark: #000000;
    --title: #000080;
    --link: #0000ee;
    --message-blue: #0000a0;
    --danger: #a00000;
}

* {
    box-sizing: border-box;
}

[hidden] {
    display: none !important;
}

.contact-only {
    display: none;
}

html.contact-mode .contribute-only {
    display: none !important;
}

html.contact-mode .contact-only {
    display: block;
}

html.contact-mode #contact-choices {
    min-height: 0;
}

button,
input,
textarea {
    font: inherit;
}

.aim-window a {
    color: var(--link);
}

.desktop-shell {
    width: min(940px, calc(100% - 32px));
    margin: 0 auto;
    padding: 20px 0 14px;
}

.period-room-label {
    margin: 0 0 9px;
    color: var(--muted);
    font-size: 11px;
}

.period-room-label span {
    margin-right: 5px;
    color: var(--plum);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.aim-window {
    border-top: 2px solid var(--light);
    border-left: 2px solid var(--light);
    border-right: 2px solid var(--dark);
    border-bottom: 2px solid var(--dark);
    background: var(--face);
    color: #000;
    font-family: "MS Sans Serif", Tahoma, Verdana, Arial, sans-serif;
    font-size: 12px;
    padding: 3px;
    box-shadow: 7px 9px 0 rgba(0, 42, 42, 0.28);
}

.window-titlebar {
    min-height: 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 3px 3px 3px 5px;
    color: #fff;
    background: linear-gradient(90deg, #000080, #1084d0);
    font-weight: 700;
}

.window-title {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.window-title img {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

.window-title span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.window-controls {
    display: flex;
    gap: 2px;
    flex: 0 0 auto;
}

.window-control {
    position: relative;
    width: 18px;
    height: 16px;
    border-top: 1px solid var(--light);
    border-left: 1px solid var(--light);
    border-right: 1px solid var(--dark);
    border-bottom: 1px solid var(--dark);
    background: var(--face);
    box-shadow: inset -1px -1px 0 var(--shadow), inset 1px 1px 0 var(--midlight);
}

.window-minimize::after {
    content: "";
    position: absolute;
    left: 4px;
    bottom: 3px;
    width: 7px;
    height: 2px;
    background: #000;
}

.window-maximize::after {
    content: "";
    position: absolute;
    inset: 3px 4px 4px;
    border: 1px solid #000;
    border-top-width: 2px;
}

.window-close::before,
.window-close::after {
    content: "";
    position: absolute;
    left: 8px;
    top: 3px;
    width: 2px;
    height: 10px;
    background: #000;
    transform: rotate(45deg);
}

.window-close::after {
    transform: rotate(-45deg);
}

.menu-bar {
    min-height: 22px;
    display: flex;
    align-items: center;
    gap: 1px;
    padding: 1px 4px;
    border-bottom: 1px solid var(--shadow);
}

.menu-bar a,
.menu-bar span {
    padding: 3px 7px;
    color: #000;
    text-decoration: none;
}

.menu-bar a::first-letter,
.menu-bar span::first-letter {
    text-decoration: underline;
}

.menu-bar a:hover,
.menu-bar a:focus-visible {
    color: #fff;
    background: var(--title);
    outline: 0;
}

.im-header {
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 5px 8px;
    border-bottom: 1px solid var(--shadow);
}

.im-header strong {
    font-size: 13px;
}

.warning-level {
    color: #800000;
}

.message-layout {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 5px;
    padding: 5px;
}

.icon-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 9px;
    padding: 7px 4px;
    border-top: 1px solid var(--shadow);
    border-left: 1px solid var(--shadow);
    border-right: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
    background: #d8d8d8;
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--midlight);
    text-align: center;
}

.buddy-icon-well {
    display: grid;
    justify-items: center;
    gap: 3px;
    color: #000080;
    font-size: 10px;
    line-height: 11px;
}

.buddy-icon {
    width: 52px;
    height: 52px;
    object-fit: contain;
    border-top: 1px solid var(--shadow);
    border-left: 1px solid var(--shadow);
    border-right: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
    background: #fff;
    image-rendering: auto;
}

.runner-icon {
    padding: 9px;
}

.you-icon {
    margin-top: 2px;
}

.icon-rail a {
    margin-top: 4px;
    font-size: 10px;
    line-height: 11px;
}

.conversation-column {
    min-width: 0;
}

.transcript {
    min-height: 190px;
    padding: 9px 10px 11px;
    overflow: auto;
    border-top: 1px solid var(--shadow);
    border-left: 1px solid var(--shadow);
    border-right: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
    background: #fff;
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--midlight);
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

.transcript p {
    margin: 7px 0;
}

.system-line {
    color: #606060;
    font-size: 12px;
}

.transcript h1,
.transcript h2,
.thanks-panel h2 {
    margin: 7px 0;
    font-size: 13px;
    line-height: 1.35;
}

.transcript h1 span,
.transcript h2 span,
.thanks-panel h2 span,
.sender-name {
    color: var(--message-blue);
    font-weight: 700;
}

.choice-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    margin-top: 9px;
}

.choice-card {
    min-width: 0;
    min-height: 77px;
    display: grid;
    grid-template-columns: 48px minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    padding: 6px;
    border-top: 1px solid var(--light);
    border-left: 1px solid var(--light);
    border-right: 1px solid var(--dark);
    border-bottom: 1px solid var(--dark);
    background: var(--face);
    box-shadow: inset -1px -1px 0 var(--shadow), inset 1px 1px 0 var(--midlight);
    color: #000;
    text-decoration: none;
}

.choice-card:hover,
.choice-card:focus-visible {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

.choice-card:active,
.choice-card.is-selected {
    border-top-color: var(--shadow);
    border-left-color: var(--shadow);
    border-right-color: var(--light);
    border-bottom-color: var(--light);
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--midlight);
    background: #d4d4d4;
}

.choice-card img {
    max-width: 47px;
    max-height: 38px;
    justify-self: center;
}

.choice-card > span {
    min-width: 0;
    display: grid;
    gap: 3px;
}

.choice-card small {
    color: #404040;
    font-size: 11px;
    line-height: 1.25;
}

.contribution-panel {
    margin-top: 5px;
    border-top: 1px solid var(--light);
    border-left: 1px solid var(--light);
    border-right: 1px solid var(--shadow);
    border-bottom: 1px solid var(--shadow);
    background: var(--face);
}

.enhanced .contribution-panel:not(.is-active) {
    display: none;
}

.panel-heading {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 14px;
    padding: 8px 9px 0;
}

.panel-heading h2 {
    display: inline;
    margin: 0 0 0 3px;
    font: 700 13px/1.35 Arial, Helvetica, sans-serif;
}

.change-choice {
    flex: 0 0 auto;
    font-size: 11px;
}

.panel-intro {
    margin: 5px 9px 8px;
    max-width: 750px;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 13px;
    line-height: 1.4;
}

.compose-toolbar {
    height: 26px;
    display: flex;
    align-items: center;
    padding: 2px 7px;
    border-top: 1px solid var(--light);
    border-bottom: 1px solid var(--shadow);
}

.compose-toolbar img {
    width: 102px;
    height: 11px;
}

.contribution-form {
    display: grid;
    gap: 12px;
    margin: 5px;
    padding: 11px;
    border-top: 1px solid var(--shadow);
    border-left: 1px solid var(--shadow);
    border-right: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
    background: #fff;
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--midlight);
}

.field {
    display: grid;
    gap: 4px;
}

.field > span {
    font-weight: 700;
}

.field small {
    color: #555;
    font-weight: 400;
}

.field b {
    color: #800000;
    font-size: 10px;
    text-transform: uppercase;
}

.field input,
.field textarea {
    width: 100%;
    border-top: 1px solid var(--shadow);
    border-left: 1px solid var(--shadow);
    border-right: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
    border-radius: 0;
    background: #fff;
    color: #000;
    padding: 6px 7px;
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--midlight);
}

.field input {
    min-height: 31px;
}

.field textarea {
    resize: vertical;
    line-height: 1.35;
}

.field input:focus,
.field textarea:focus {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

.contact-grid,
.picker-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.file-picker,
.file-field {
    min-width: 0;
    display: grid;
    align-content: start;
    gap: 4px;
    padding: 9px;
    border-top: 1px solid var(--light);
    border-left: 1px solid var(--light);
    border-right: 1px solid var(--shadow);
    border-bottom: 1px solid var(--shadow);
    background: var(--face);
}

.file-picker span {
    color: #444;
    font-size: 11px;
}

.file-picker input,
.file-field input {
    max-width: 100%;
    margin-top: 6px;
    padding: 3px;
    box-shadow: none;
}

.drop-zone {
    min-height: 82px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    padding: 10px;
    border: 2px dotted var(--shadow);
    background: #f7f7f7;
    color: #444;
    text-align: center;
}

.drop-zone img {
    width: 18px;
    height: 22px;
    margin-bottom: 2px;
    object-fit: contain;
}

.drop-zone strong {
    color: #000;
}

.drop-zone span {
    font-size: 11px;
}

.drop-zone.is-dragging {
    border-color: var(--title);
    background: #ffffdf;
}

.file-summary {
    padding: 7px 8px;
    border: 1px solid var(--shadow);
    background: #ffffdf;
}

.confirm-field {
    display: flex;
    align-items: start;
    gap: 7px;
    max-width: 760px;
    color: #333;
    font-size: 11px;
    line-height: 1.35;
}

.confirm-field input {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    margin: 0;
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.form-actions {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    margin: 0 -11px -11px;
    padding: 5px 8px;
    border-top: 1px solid var(--shadow);
    background: var(--face);
}

.form-status {
    margin-right: auto;
    color: #333;
}

.form-status.is-error {
    color: var(--danger);
    font-weight: 700;
}

.aim-bitmap-button {
    min-width: 0;
    min-height: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1px;
    border-top: 1px solid var(--light);
    border-left: 1px solid var(--light);
    border-right: 1px solid var(--dark);
    border-bottom: 1px solid var(--dark);
    border-radius: 0;
    background: var(--face);
    box-shadow: inset -1px -1px 0 var(--shadow), inset 1px 1px 0 var(--midlight);
    cursor: pointer;
}

.aim-bitmap-button.is-default {
    outline: 1px solid #000;
    outline-offset: 2px;
}

.aim-bitmap-button img {
    display: block;
    width: 47px;
    height: 38px;
    pointer-events: none;
}

.aim-bitmap-button:active,
.aim-bitmap-button.is-pressed {
    border-top-color: var(--shadow);
    border-left-color: var(--shadow);
    border-right-color: var(--light);
    border-bottom-color: var(--light);
    box-shadow: inset 1px 1px 0 var(--dark), inset -1px -1px 0 var(--midlight);
}

.aim-bitmap-button:focus-visible {
    outline: 1px dotted #000;
    outline-offset: -4px;
}

.aim-bitmap-button:disabled {
    cursor: wait;
}

.thanks-panel {
    margin-top: 5px;
}

.thanks-panel:focus {
    outline: none;
}

.sent-message {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.sent-message strong {
    color: var(--message-blue);
}

.auto-response-line > strong {
    color: #a00000;
    font-weight: 700;
}

.away-message {
    display: inline;
    overflow-wrap: anywhere;
    color: #000080;
    font-family: Arial, sans-serif;
    font-size: 13px;
    line-height: 1.3;
}

.away-line {
    display: inline;
    white-space: normal;
}

.away-line + .away-line::before {
    content: "  ";
    white-space: pre;
}

.away-headline,
.away-status {
    font-weight: 700;
}

.away-headline {
    font-size: 1.12em;
}

.away-quote {
    font-family: "Times New Roman", serif;
    font-size: 1.13em;
    font-style: italic;
    font-weight: 700;
}

.away-small,
.away-blog {
    font-size: 0.88em;
}

.away-message a,
.away-message a:visited {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
}

.away-message[data-away-style="classic-blue"] {
    color: #0000a0;
    font-family: Arial, sans-serif;
}

.away-message[data-away-style="purple-center"] {
    color: #660099;
    font-family: "Times New Roman", serif;
}

.away-message[data-away-style="forest"] {
    color: #075c32;
    font-family: Georgia, "Times New Roman", serif;
}

.away-message[data-away-style="terminal"] {
    color: #000;
    font-family: "Courier New", monospace;
    font-size: 12px;
}

.away-message[data-away-style="hot-pink"] {
    color: #b00078;
    font-family: "Comic Sans MS", "Trebuchet MS", sans-serif;
}

.away-message[data-away-style="rainbow"] {
    color: #0000a0;
    font-family: Arial, sans-serif;
}

.away-message[data-away-style="rainbow"] .away-line:nth-child(2) {
    color: #800080;
}

.away-message[data-away-style="rainbow"] .away-line:nth-child(3) {
    color: #008000;
}

.away-message[data-away-style="rainbow"] .away-line:nth-child(4) {
    color: #c00000;
}

.away-message[data-away-style="alert-red"] {
    color: #c00000;
    font-family: Verdana, Arial, sans-serif;
}

.away-message[data-away-style="midnight"] {
    color: #000040;
    font-family: Arial, sans-serif;
}

.away-message[data-away-style="orange"] {
    color: #a04000;
    font-family: Verdana, Arial, sans-serif;
}

.thanks-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.thanks-actions a {
    min-height: 28px;
    display: inline-flex;
    align-items: center;
    padding: 5px 12px;
    border-top: 1px solid var(--light);
    border-left: 1px solid var(--light);
    border-right: 1px solid var(--dark);
    border-bottom: 1px solid var(--dark);
    background: var(--face);
    box-shadow: inset -1px -1px 0 var(--shadow), inset 1px 1px 0 var(--midlight);
    color: #000;
    text-decoration: none;
}

.thanks-actions a:active {
    border-top-color: var(--shadow);
    border-left-color: var(--shadow);
    border-right-color: var(--light);
    border-bottom-color: var(--light);
}

.status-bar {
    min-height: 25px;
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 5px;
    border-top: 1px solid var(--light);
}

.status-bar > span {
    min-width: 0;
    flex: 1 1 auto;
    padding: 3px 5px;
    border-top: 1px solid var(--shadow);
    border-left: 1px solid var(--shadow);
    border-right: 1px solid var(--light);
    border-bottom: 1px solid var(--light);
}

.status-bar > img:not(.brand-logo) {
    width: 14px;
    height: 17px;
    object-fit: contain;
}

.brand-logo {
    width: 149px;
    height: 16px;
    margin-left: 5px;
}

.page-footer {
    width: min(940px, calc(100% - 32px));
    margin: 8px auto 28px;
}

@media (max-width: 760px) {
    .desktop-shell,
    .page-footer {
        width: min(100% - 16px, 940px);
    }

    .desktop-shell {
        padding-top: 8px;
    }

    .choice-grid,
    .contact-grid,
    .picker-grid {
        grid-template-columns: 1fr;
    }

    .choice-card {
        min-height: 66px;
    }

    .brand-logo {
        display: none;
    }
}

@media (max-width: 520px) {
    .message-layout {
        grid-template-columns: 1fr;
    }

    .icon-rail {
        display: none;
    }

    .warning-level {
        font-size: 10px;
    }

    .transcript {
        min-height: 0;
    }

    .panel-heading {
        display: block;
    }

    .change-choice {
        display: inline-block;
        margin-top: 5px;
    }

    .contribution-form {
        padding: 8px;
    }

    .field input,
    .field textarea {
        font-size: 16px;
    }

    .form-actions {
        margin: 0 -8px -8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
    }
}
