/* ===== GLOBAL ===== */

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    background: #000;
    color: #eaf0ff;
    font-family: Arial, Helvetica, sans-serif;
}

a {
    color: inherit;
}

/* ===== BETA NOTICE ===== */

.beta-banner {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    padding: 9px 18px;
    border-top: 1px solid #6f5416;
    border-bottom: 1px solid #6f5416;
    background: #241704;
    color: #ffe37a;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.beta-icon {
    font-size: 17px;
    line-height: 1;
}

/* ===== TOP NAVIGATION ===== */

.top-nav {
    width: 100%;
    background: #0b0b0b;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.top-nav-inner {
    width: min(1120px, calc(100% - 32px));
    min-height: 72px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.top-nav-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 46px;
    padding: 10px 17px;
    border-radius: 9px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 700;
    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.nav-icon {
    font-size: 20px;
    line-height: 1;
}

.home-link {
    border: 1px solid rgba(103, 173, 255, 0.45);
    background: #1c3d71;
    color: #fff;
    box-shadow:
        0 0 12px rgba(103, 173, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.home-link:hover,
.home-link:focus-visible {
    transform: translateY(-2px);
    border-color: #67adff;
    background: #24549a;
    box-shadow:
        0 0 18px rgba(103, 173, 255, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.coffee-link {
    border: 1px solid #f1d67b;
    background: #e0b330;
    color: #231700;
    box-shadow:
        0 0 14px rgba(224, 179, 48, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.coffee-link:hover,
.coffee-link:focus-visible {
    transform: translateY(-2px);
    border-color: #ffe27a;
    background: #f0c84d;
    box-shadow:
        0 0 18px rgba(224, 179, 48, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* ===== BANNER ===== */

.banner {
    width: 100%;
    background: #000;
}

.banner img {
    display: block;
    width: 100%;
    max-width: 1100px;
    height: auto;
    margin: 0 auto;
}

/* ===== SHARED PAGE LAYOUT ===== */

.page-shell,
.container,
.home-page {
    width: min(1120px, calc(100% - 32px));
    margin: 28px auto 48px;
}

.generator-box,
.widget {
    padding: 24px;
    border-radius: 12px;
    background: #35568c;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

.generator-box {
    max-width: 1100px;
    margin: 0 auto;
}

.widget {
    width: min(1050px, 100%);
    margin: 15px auto 0;
}

.activity-widget {
    overflow: hidden;
}

h1,
h2,
.widget-title {
    color: #fff;
}

h2,
.widget-title {
    margin: 0 0 20px;
    text-align: center;
    font-weight: 700;
}

h2 {
    font-size: clamp(28px, 4vw, 40px);
}

.widget-title {
    font-size: clamp(21px, 3vw, 27px);
}

/* ===== SES FILTER ===== */

.ses-filter-bar {
    width: min(1050px, 100%);
    margin: 0 auto 12px;
    display: flex;
    justify-content: flex-end;
}

.ses-filter-form {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border-radius: 7px;
    background: #294779;
}

.ses-filter-form label {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.ses-filter-form input {
    width: 72px;
    height: 34px;
    padding: 0 7px;
    text-align: center;
}

.ses-filter-form button {
    width: auto;
    height: 34px;
    min-height: 34px;
    margin: 0;
    padding: 0 13px;
    font-size: 13px;
}

/* ===== FORMS ===== */

label {
    display: block;
    margin: 0 0 8px;
    color: #fff;
    font-weight: 700;
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #294a83;
    border-radius: 7px;
    background: #13264d;
    color: #fff;
    font: inherit;
}

input::placeholder,
textarea::placeholder {
    color: #aebbd8;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #67adff;
    box-shadow: 0 0 0 3px rgba(103, 173, 255, 0.22);
}

textarea {
    min-height: 140px;
    resize: vertical;
}

button {
    padding: 12px 22px;
    border: 0;
    border-radius: 7px;
    background: #1d75ff;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background: #3d8cff;
}

button:focus-visible {
    outline: 3px solid rgba(255, 255, 255, 0.7);
    outline-offset: 2px;
}

button + button {
    margin-left: 10px;
}

.checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0;
}

.checkbox-row input {
    width: auto;
}

.section-divider {
    margin: 30px 0;
    border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.copy-label {
    margin-bottom: 10px;
    font-weight: 700;
}

#output {
    width: 100%;
    height: 250px;
}

#preview {
    padding: 10px;
    overflow-x: auto;
    border-radius: 8px;
    background: #35568c;
    color: #000;
}

/* ===== STATUS MESSAGES ===== */

.status-message {
    padding: 18px;
    border-radius: 8px;
    background: #294779;
    text-align: center;
    line-height: 1.5;
}

.status-error {
    background: #7a2f3d;
}

.status-detail {
    margin-top: 8px;
    color: #d8e3ff;
    font-size: 14px;
}

.selection-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.selection-card {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 16px;
    border: 1px solid rgba(143, 196, 255, 0.25);
    border-radius: 9px;
    background: #13264d;
}

.selection-card strong {
    color: #fff;
    font-size: 17px;
}

.selection-card span {
    color: #d8e3ff;
    line-height: 1.4;
}

.selection-card button {
    width: 100%;
    margin-top: auto;
}

.result-summary {
    margin: 0 0 15px;
    padding: 12px 14px;
    border-radius: 8px;
    background: #294779;
    color: #edf3ff;
    line-height: 1.45;
}

.generator-help {
    margin: -4px 0 18px;
    color: #d8e3ff;
    font-size: 14px;
    line-height: 1.45;
}

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

/* ===== ACTIVITY TABLE ===== */

.table-wrap {
    width: 100%;
    overflow-x: auto;
    border-radius: 8px;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    min-width: 720px;
    border-collapse: collapse;
    background: rgba(8, 26, 63, 0.18);
}

th,
td {
    padding: 13px 14px;
    text-align: left;
    vertical-align: middle;
}

th {
    background: #294779;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
}

td {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #edf3ff;
    font-size: 15px;
}

tbody tr:hover {
    background: rgba(255, 255, 255, 0.06);
}

.callsign,
.freq,
.time {
    white-space: nowrap;
}

.callsign {
    font-weight: 700;
}

.mode {
    display: inline-block;
    min-width: 52px;
    padding: 5px 10px;
    border-radius: 999px;
    color: #fff;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
}

.mode-SSB {
    background: #0d6efd;
}

.mode-CW {
    background: #198754;
}

.mode-FT8 {
    background: #fd7e14;
}

.mode-DIGI {
    background: #6f42c1;
}

/* ===== GENERATOR MEDIA ===== */

.media {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-top: 30px;
}

.media img {
    width: 300px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

iframe {
    width: 100%;
    height: 300px;
    border: 0;
    border-radius: 8px;
}

/* ===== HOME PAGE ===== */

.home-page {
    margin-top: 38px;
    margin-bottom: 60px;
}

.home-intro {
    margin-bottom: 30px;
    text-align: center;
}

.home-intro h1 {
    margin: 0 0 12px;
    font-size: clamp(32px, 5vw, 48px);
    line-height: 1.15;
}

.home-intro p {
    margin: 0 auto;
    color: #bfcceb;
    font-size: 17px;
    line-height: 1.5;
    white-space: nowrap;
}

/* ===== TOOL CARDS ===== */

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

.tool-card {
    display: flex;
    gap: 18px;
    min-height: 180px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    background: #35568c;
    color: #eaf0ff;
    text-decoration: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    transition:
        transform 0.2s ease,
        background-color 0.2s ease,
        border-color 0.2s ease;
}

a.tool-card:hover,
a.tool-card:focus-visible {
    transform: translateY(-4px);
    background: #3f639d;
    border-color: rgba(103, 173, 255, 0.6);
}

.tool-icon {
    display: flex;
    flex: 0 0 56px;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: #13264d;
    font-size: 27px;
}

.tool-content {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.tool-content h2 {
    margin: 0 0 10px;
    text-align: left;
    font-size: 23px;
}

.tool-content p {
    margin: 0 0 20px;
    color: #d8e3ff;
    line-height: 1.55;
}

.tool-link,
.coming-soon {
    margin-top: auto;
    font-size: 14px;
    font-weight: 700;
}

.tool-link {
    color: #8fc4ff;
}

.coming-soon {
    color: #b7c2da;
}

.tool-disabled {
    opacity: 0.68;
    cursor: default;
}

/* ===== EXTERNAL LINKS ===== */

.external-links-section {
    margin-top: 34px;
    padding: 20px 22px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    background: rgba(53, 86, 140, 0.28);
}

.external-links-header {
    margin-bottom: 14px;
}

.external-links-header h2 {
    margin: 0 0 5px;
    text-align: left;
    font-size: 18px;
}

.external-links-header p {
    margin: 0;
    color: #aebbd8;
    font-size: 14px;
}

.external-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.external-links a {
    display: inline-block;
    padding: 8px 11px;
    border: 1px solid rgba(143, 196, 255, 0.2);
    border-radius: 7px;
    background: rgba(19, 38, 77, 0.65);
    color: #9ecbff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
}

.external-links a:hover,
.external-links a:focus-visible {
    border-color: rgba(143, 196, 255, 0.55);
    background: #294779;
    color: #fff;
}

/* ===== FOOTER ===== */

.site-footer {
    padding: 24px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    color: #8592ae;
    text-align: center;
    font-size: 14px;
}

/* ===== TABLET ===== */

@media (max-width: 900px) {
    .page-shell,
    .container {
        width: calc(100% - 24px);
        margin-top: 20px;
    }

    .generator-box,
    .widget {
        padding: 19px;
    }

    .widget {
        width: 100%;
    }
}

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

@media (max-width: 760px) {
    .top-nav-inner,
    .home-page {
        width: calc(100% - 20px);
    }

    .top-nav-inner {
        min-height: 64px;
        gap: 10px;
    }

    .top-nav-link {
        min-height: 42px;
        padding: 9px 12px;
        font-size: 14px;
    }

    .nav-icon {
        font-size: 17px;
    }

    .home-page {
        margin-top: 24px;
    }

    .home-intro p {
        white-space: normal;
    }

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

    .tool-card {
        min-height: 0;
        padding: 20px;
    }
}

@media (max-width: 640px) {
    .beta-banner {
        min-height: 42px;
        padding: 8px 12px;
        font-size: 13px;
    }

    .page-shell,
    .container {
        width: calc(100% - 16px);
        margin: 12px auto 25px;
    }

    .generator-box,
    .widget {
        padding: 15px;
        border-radius: 9px;
    }

    .ses-filter-bar {
        justify-content: center;
    }

    .ses-filter-form,
    .ses-filter-form button {
        width: auto;
    }

    table {
        min-width: 680px;
    }

    th,
    td {
        padding: 11px 12px;
    }

    button {
        width: 100%;
        margin-top: 10px;
    }

    .ses-filter-form button {
        margin: 0;
    }

    button + button {
        margin-left: 0;
    }

    .media img {
        width: 100%;
    }

    .inline-fields {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

@media (max-width: 430px) {
    .top-nav-inner {
        flex-direction: column;
        align-items: stretch;
        padding: 12px 0;
    }

    .top-nav-link {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 420px) {
    .tool-card {
        display: block;
    }

    .tool-icon {
        margin-bottom: 16px;
    }

    .tool-content h2 {
        font-size: 21px;
    }

    .external-links {
        display: grid;
        grid-template-columns: 1fr;
    }

    .external-links a {
        text-align: center;
    }
}

/* ===== ARTICLE PICKER ===== */

.article-picker {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 46px;
    padding: 7px 9px;
    border: 1px solid rgba(103, 173, 255, 0.45);
    border-radius: 9px;
    background: #1c3d71;
    box-shadow:
        0 0 12px rgba(103, 173, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.article-picker-icon {
    font-size: 20px;
    line-height: 1;
}

.article-select {
    width: 290px;
    height: 34px;
    padding: 0 32px 0 10px;
    border: 0;
    border-radius: 6px;
    background: #13264d;
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.article-select:focus {
    outline: 2px solid #67adff;
    box-shadow: none;
}

.article-open-button {
    width: auto;
    min-height: 34px;
    margin: 0;
    padding: 0 13px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    background: #24549a;
    color: #fff;
    font-size: 13px;
}

.article-open-button:hover {
    background: #3170c9;
}

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

@media (max-width: 700px) {
    .article-picker {
        flex: 1;
    }

    .article-select {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 430px) {
    .article-picker {
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
    }

    .article-select {
        flex: 1;
        min-width: 180px;
    }

    .article-open-button {
        width: auto;
        margin: 0;
    }
}

/* =========================================================
   HOW-TO ARTICLES CARD
   ========================================================= */

.howto-card .tool-content{
    justify-content:flex-start;
}

.howto-label{
    display:block;
    margin:18px 0 8px;
    color:#d8e3ff;
    font-size:14px;
    font-weight:700;
}

.howto-row{
    display:flex;
    align-items:center;
    gap:12px;
    margin-top:4px;
}

.howto-select{
    flex:1;
    min-height:44px;

    padding:0 14px;

    border:1px solid #294a83;
    border-radius:8px;

    background:#13264d;
    color:#fff;

    font-size:15px;
    font-weight:600;

    cursor:pointer;
}

.howto-select:hover{
    border-color:#4d83d9;
}

.howto-select:focus{
    outline:none;
    border-color:#67adff;
    box-shadow:0 0 0 3px rgba(103,173,255,.20);
}

.howto-button{
    width:auto;
    min-width:105px;
    min-height:44px;

    margin:0;
    padding:0 20px;

    border-radius:8px;

    font-size:15px;
    font-weight:700;
}

.howto-button:hover{
    transform:translateY(-1px);
}

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

@media (max-width:700px){

    .howto-row{
        flex-direction:column;
        align-items:stretch;
    }

    .howto-button{
        width:100%;
    }

}
