/* static/css/trial_code.css */

.trial-header {
    width: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    background: #fffaf0;
    border-bottom: 0.0625rem solid #f0d8a8;
}

.paid-header {
    background: #eef9ff;
    border-bottom-color: #b9e6f8;
    position: relative;
}

.trial-main {
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
    box-sizing: border-box;
}

.trial-left {
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

/* trial / paid 共通：カレンダーヘッダー用アニメーションSVGロゴ */
.calendar-service-title {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    width: 7.5rem;
    height: 2.7rem;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    line-height: 1;
    overflow: hidden;
}

.calendar-service-title svg {
    display: block;
    width: 10.5rem;
    height: 2.7rem;
    margin: 0 0 0 -1.5rem;
    padding: 0;
    flex: 0 0 auto;
}

.calendar-service-title-text {
    font-size: 2.1rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.calendar-service-title-fallback {
    position: absolute;
    width: 0.0625rem;
    height: 0.0625rem;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* 無料版：説明文行。ロゴをこの左に配置 */
.trial-note {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
    color: #666;
    font-size: 0.8125rem;
    line-height: 1.5;
}

.trial-note-text {
    display: inline-block;
    flex: 1;
    min-width: 0;
    margin: 0;
    padding: 0;
}

/* 無料版：再開コード・ボタン行だけ左と下に余白を戻す */
.trial-code-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0 0 0.5rem 0.875rem;
    font-size: 0.9375rem;
}

.paid-code-line {
    gap: 0.375rem;
}

.trial-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.1875rem 0.625rem;
    border-radius: 62.4375rem;
    background: #f0a202;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    white-space: nowrap;
}

.paid-label {
    background: #36aeea;
}

.trial-label-authenticated {
    background: #3a7bd5;
}

.trial-code-text {
    color: #333;
    white-space: nowrap;
}

.trial-code-highlight,
.trial-user-email-highlight {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 0.375rem;
    background: #fff;
    border: 0.0625rem solid #e5c36b;
    color: #222;
    letter-spacing: 0.06em;
}

.trial-reset-form {
    display: inline-flex;
    gap: 0.375rem;
    align-items: center;
    margin: 0;
    padding: 0;
}

.trial-reset-form input[type="text"] {
    width: 10rem;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.4375rem 0.5625rem;
    border: 0.0625rem solid #ccc;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: #222;
    background: #fff;
}

/* ブラウザのオートフィル背景（薄黄色）がページ背景の #fffaf0 と近く、
   入力欄がバックグラウンドに溶け込んで見えるのを防ぐ */
.trial-reset-form input[type="text"]:-webkit-autofill,
.trial-reset-form input[type="text"]:-webkit-autofill:hover,
.trial-reset-form input[type="text"]:-webkit-autofill:focus {
    -webkit-text-fill-color: #222;
    -webkit-box-shadow: 0 0 0 62.4375rem #fff inset;
    box-shadow: 0 0 0 62.4375rem #fff inset;
    transition: background-color 999999s ease-in-out 0s;
}

.trial-reset-form button,
.trial-reset-btn,
.trial-code-line .trial-action-link,
.trial-code-line .trial-action-link:visited {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    border: none;
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    background: #333;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}

.trial-reset-form button:hover,
.trial-reset-btn:hover,
.trial-code-line .trial-action-link:hover,
.trial-code-line .trial-action-link:focus {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

.trial-code-line .trial-action-link:active {
    transform: translateY(0.0625rem);
}

.trial-record-accordion-inline {
    display: inline-block;
    position: relative;
}

.trial-record-summary-inline {
    cursor: pointer;
    padding: 0.1875rem 0.5rem;
    border-radius: 0.375rem;
    background: #fff;
    border: 0.0625rem solid #e5c36b;
    color: #333;
    font-size: 0.8125rem;
    list-style: none;
}

.trial-record-summary-inline::-webkit-details-marker {
    display: none;
}

.trial-record-body-inline {
    position: absolute;
    z-index: 20;
    top: calc(100% + 0.375rem);
    left: 0;
    min-width: 13.75rem;
    padding: 0.625rem 0.75rem;
    border-radius: 0.5rem;
    background: #fff;
    border: 0.0625rem solid #e5c36b;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.12);
    color: #333;
}

.trial-record-line-inline {
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: nowrap;
}

/* 利用規約ボタン（グレー共通スタイル） */
.trial-terms-summary {
    border-color: #bbb;
    color: #555;
}

/* 利用規約ポップアップ */
.trial-terms-popup {
    min-width: 32rem;
    max-width: min(50rem, calc(100vw - 2rem));
    left: 0;
    right: auto;
    border-color: #bbb;
}

.trial-terms-scroll {
    max-height: 10rem;
    overflow-y: auto;
    overflow-x: hidden;
}

.trial-terms-text {
    font-size: 0.75rem;
    line-height: 1.7;
    color: #555;
    white-space: pre-wrap;
    word-break: break-word;
}

.trial-record-group {
    padding: 0.25rem 0;
}

.trial-record-divider {
    border-top: 0.0625rem solid #e0e0e0;
    margin: 0.375rem 0;
}

.trial-record-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #888;
    letter-spacing: 0.04em;
    margin-bottom: 0.125rem;
    text-transform: uppercase;
}

.rate-limit-error {
    margin: 0;
    width: 100%;
    padding: 0.4375rem 0.625rem;
    border-radius: 0.375rem;
    background: #ffe5e5;
    color: #b00020;
    font-size: 0.8125rem;
    box-sizing: border-box;
}

.paid-record-summary-inline {
    border-color: #8fcfe8;
}

.paid-record-body-inline {
    border-color: #8fcfe8;
}

.paid-record-period {
    font-size: 0.78rem;
    color: #4a7a8a;
    margin-bottom: 0.2rem;
}

.paid-record-section-label {
    font-weight: bold;
    font-size: 0.78rem;
    color: #3a7a9a;
    margin-top: 0.3rem;
    border-top: 1px solid #c8e8f5;
    padding-top: 0.3rem;
}

/* 有料版ヘッダー */

.paid-header-top {
    width: 100%;
    margin: 0;
    padding: 0;
}

.paid-header-title-line {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0 0 0.5rem 0.875rem;
}

.paid-header-note {
    color: #24566b;
    font-size: 0.875rem;
    font-weight: 700;
    white-space: nowrap;
}

.paid-menu-row {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    padding: 0;
}

.paid-menu-group {
    position: relative;
    display: inline-flex;
    align-items: center;
    min-height: 1.5rem;
    margin: 0;
    padding: 0;
}

.paid-menu-group-title {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    border: 0.0625rem solid #b9e6f8;
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    background: #ffffff;
    color: #24566b;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    box-sizing: border-box;
}

.paid-menu-group-title:hover,
.paid-menu-group-title:focus {
    background: #e4f6fd;
}

.paid-menu-group.is-active .paid-menu-group-title {
    background: #1f5f7a;
    border-color: #1f5f7a;
    color: #ffffff;
}

.paid-menu-links {
    display: none;
    position: absolute;
    z-index: 30;
    top: calc(100% + 0.375rem);
    left: 0;
    min-width: max-content;
    max-width: calc(100vw - 2rem);
    padding: 0.5rem;
    border: 0.0625rem solid #b9e6f8;
    border-radius: 0.75rem;
    background: #ffffff;
    box-shadow: 0 0.5rem 1.25rem rgba(0, 0, 0, 0.14);
    box-sizing: border-box;
}

.paid-menu-group.is-active .paid-menu-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.paid-menu-group--right .paid-menu-links {
    left: auto;
    right: 0;
}

.paid-menu-group .trial-action-link,
.paid-menu-group .trial-action-link:visited {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    border: none;
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    background: #1f5f7a;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}

.paid-menu-group .trial-manual-link,
.paid-menu-group .trial-manual-link:visited,
.trial-code-line .trial-manual-link,
.trial-code-line .trial-manual-link:visited,
.trial-code-line .trial-security-link,
.trial-code-line .trial-security-link:visited {
    background: #5aaeca;
    color: #fff;
}

.trial-code-line .trial-manual-link:hover,
.trial-code-line .trial-manual-link:focus,
.trial-code-line .trial-security-link:hover,
.trial-code-line .trial-security-link:focus {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

.paid-menu-group .trial-action-link:hover,
.paid-menu-group .trial-action-link:focus {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

.paid-menu-group .trial-action-link:active {
    transform: translateY(0.0625rem);
}

.paid-menu-group-muted .paid-menu-group-title {
    background: #f7fcff;
}

.paid-user-email {
    position: absolute;
    bottom: -1.4rem;
    left: 1rem;
    z-index: 5;
    font-size: 0.8rem;
    color: #818181;
    background: rgba(212, 212, 212, 0.8);
    padding: 0.2rem 0.6rem;
    border-radius: 0.2rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 16rem;
    pointer-events: none;
}

.paid-logout-form button {
    background: #4d6470;
}

.paid-logout-form button:hover,
.paid-logout-form button:focus {
    opacity: 0.85;
    color: #fff;
}

.paid-home-link,
.paid-home-link:visited {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.5rem;
    border: none;
    border-radius: 0.375rem;
    padding: 0.2rem 0.5rem;
    background: #333;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
    box-sizing: border-box;
}

.paid-home-link:hover,
.paid-home-link:focus {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 48rem) {
    .trial-header {
        padding: 0;
        margin: 0;
    }

    .calendar-service-title {
        width: 6.8rem;
        height: 2.4rem;
    }

    .calendar-service-title svg {
        width: 8.7rem;
        height: 2.4rem;
        margin: 0 0 0 -1.25rem;
    }

    .calendar-service-title-text {
        font-size: 1.86rem;
    }

    .trial-note {
        display: block;
        margin: 0;
        padding: 0.3rem 0 0.4rem 1.25rem;
    }

    .trial-note .calendar-service-title {
        display: inline-block;
        vertical-align: middle;
        margin-left: -1.25rem;
        margin-right: 0.25rem;
        height: 1.3rem;
        overflow: hidden;
    }

    .trial-note .calendar-service-title svg {
        margin-top: -0.55rem;
    }

    .trial-note-text {
        display: inline;
        line-height: 1.2;
        vertical-align: middle;
    }

    .trial-code-line {
        align-items: center;
        justify-content: flex-start;
        padding: 0 0 0.5rem 0.75rem;
    }

    .trial-reset-form {
        width: auto;
    }

    .trial-resume-form input[type="text"] {
        width: 8rem;
    }

    .trial-code-line .trial-action-link,
    .paid-menu-group .trial-action-link,
    .trial-reset-form button,
    .trial-reset-btn,
    .paid-menu-group-title,
    .paid-home-link,
    .paid-home-link:visited {
        min-height: 1.5rem;
        padding: 0.2rem 0.5rem;
        font-size: 0.8rem;
    }

    .trial-record-body-inline {
        left: 0;
        right: auto;
    }

    .trial-terms-popup {
        position: fixed;
        left: 0.5rem;
        right: 0.5rem;
        min-width: auto;
        width: auto;
        top: 5.5rem;
    }

    .paid-header-title-line {
        align-items: center;
        padding: 0 0 0.5rem 0.75rem;
    }

    .paid-menu-row {
        display: inline-flex;
        flex-wrap: wrap;
        gap: 0.375rem;
        align-items: center;
        justify-content: flex-start;
        position: relative;
    }

    .paid-menu-group {
        position: relative;
    }

    .paid-menu-links {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        max-width: 100vw;
        min-width: 0;
        overflow-x: auto;
        flex-wrap: nowrap;
        z-index: 1000;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .paid-menu-group.is-active .paid-menu-links {
        display: flex;
    }
}

@media (max-width: 30rem) {
    .trial-reset-form input[type="text"] {
        width: 6.5rem;
    }

    .trial-code-line .trial-action-link,
    .paid-menu-group .trial-action-link,
    .trial-reset-form button,
    .trial-reset-btn,
    .paid-menu-group-title,
    .paid-home-link,
    .paid-home-link:visited {
        font-size: 0.75rem;
        padding: 0.15rem 0.4rem;
    }
}

/* ---- iframe 内でのヘッダー非表示 ---- */
.in-iframe .trial-header,
.in-iframe .paid-header {
    display: none !important;
}

/* ---- Manual Modal ---- */
.manual-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9000;
}
.manual-modal[aria-hidden="false"] {
    display: block;
}
.manual-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    cursor: pointer;
}
.manual-modal__dialog {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 92%;
    max-width: 960px;
    height: 88vh;
    background: #fff;
    border-radius: 0.75rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, 0.25);
}
.manual-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 1rem;
    border-bottom: 1px solid #e5e5e5;
    background: #f8f9fa;
    flex-shrink: 0;
    cursor: move;
    user-select: none;
}
.manual-modal__title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
}
.manual-modal__close {
    appearance: none;
    border: none;
    background: none;
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}
.manual-modal__close:hover {
    background: #eee;
    color: #333;
}
.manual-modal__body {
    flex: 1;
    overflow-y: auto;
}
.manual-modal__content {
    min-height: 100%;
}
.manual-modal__content .container {
    max-width: 100%;
    margin: 0;
    padding: 1.25rem 1.75rem 3rem;
    border-radius: 0;
    background: transparent;
    text-align: left;
}
.manual-modal__loading,
.manual-modal__error {
    padding: 2rem;
    text-align: center;
    color: #999;
}
.manual-modal__footer {
    flex-shrink: 0;
    min-height: 2.5rem;
    background: #f0f0f0;
    border-top: 1px solid #e5e5e5;
    cursor: move;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0 0.75rem;
}

.manual-modal__footer-close {
    appearance: none;
    border: 1px solid #bbb;
    border-radius: 0.375rem;
    background: #fff;
    color: #444;
    font-size: 0.875rem;
    font-weight: 700;
    padding: 0.3rem 1rem;
    cursor: pointer;
    user-select: none;
}

.manual-modal__footer-close:hover {
    background: #eee;
    border-color: #888;
}
.manual-modal__resize-handle {
    position: absolute;
    width: 1.75rem;
    height: 1.75rem;
    z-index: 10;
}
.manual-modal__resize-handle--se { right: 0;    bottom: 0;   cursor: nwse-resize; }
.manual-modal__resize-handle--sw { left: 0;     bottom: 0;   cursor: nesw-resize; }
.manual-modal__resize-handle--ne { right: 0;    top: 0;      cursor: nesw-resize; }
.manual-modal__resize-handle--nw { left: 0;     top: 0;      cursor: nwse-resize; }

.manual-modal__resize-handle::before,
.manual-modal__resize-handle::after {
    content: "";
    position: absolute;
}
.manual-modal__resize-handle--se::before {
    right: 0.375rem; bottom: 0.375rem;
    width: 1rem; height: 1rem;
    border-right: 0.1875rem solid #888; border-bottom: 0.1875rem solid #888;
}
.manual-modal__resize-handle--se::after {
    right: 0.75rem; bottom: 0.75rem;
    width: 0.5rem; height: 0.5rem;
    border-right: 0.125rem solid #aaa; border-bottom: 0.125rem solid #aaa;
}
.manual-modal__resize-handle--sw::before {
    left: 0.375rem; bottom: 0.375rem;
    width: 1rem; height: 1rem;
    border-left: 0.1875rem solid #888; border-bottom: 0.1875rem solid #888;
}
.manual-modal__resize-handle--sw::after {
    left: 0.75rem; bottom: 0.75rem;
    width: 0.5rem; height: 0.5rem;
    border-left: 0.125rem solid #aaa; border-bottom: 0.125rem solid #aaa;
}
.manual-modal__resize-handle--ne::before {
    right: 0.375rem; top: 0.375rem;
    width: 1rem; height: 1rem;
    border-right: 0.1875rem solid #888; border-top: 0.1875rem solid #888;
}
.manual-modal__resize-handle--ne::after {
    right: 0.75rem; top: 0.75rem;
    width: 0.5rem; height: 0.5rem;
    border-right: 0.125rem solid #aaa; border-top: 0.125rem solid #aaa;
}
.manual-modal__resize-handle--nw::before {
    left: 0.375rem; top: 0.375rem;
    width: 1rem; height: 1rem;
    border-left: 0.1875rem solid #888; border-top: 0.1875rem solid #888;
}
.manual-modal__resize-handle--nw::after {
    left: 0.75rem; top: 0.75rem;
    width: 0.5rem; height: 0.5rem;
    border-left: 0.125rem solid #aaa; border-top: 0.125rem solid #aaa;
}
@media (max-width: 768px) {
    .manual-modal__footer { display: none; }
    .manual-modal__resize-handle { display: none; }
}

/* ---- manual.css スコープ版（モーダル内専用） ---- */
.manual-modal__content {
    font-family: 'M PLUS 1p', sans-serif;
    font-size: 1.2rem;
    text-align: left;
}
.manual-modal__content .container > h1 {
    text-align: center;
    margin-bottom: 0.25rem;
}
.manual-modal__content .container h2 {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: bold;
    color: #0175d8;
    background: linear-gradient(to bottom, transparent 65%, yellow 50%);
    line-height: 1.5;
    letter-spacing: 0.08em;
    margin: 1.6rem 0 0.8rem;
}
.manual-modal__content p {
    text-align: left;
}
.manual-modal__content .slider {
    width: 100%;
    display: flex;
    gap: 15px;
    overflow-x: auto;
    border: 5px solid #c0c0c0;
}
.manual-modal__content .slide {
    flex: 0 0 auto;
    width: 800px;
    box-sizing: border-box;
}
.manual-modal__content .slider img {
    width: 100%;
    height: auto;
    display: block;
    border: 0.1rem solid blue;
    border-radius: 6px;
}
.manual-modal__content .slide p {
    color: blue;
    text-align: center;
}
.manual-modal__content .yaji-text {
    color: #898989;
    text-align: center;
    margin-bottom: 0.1rem;
    font-weight: bold;
}
.manual-modal__content .anchor-offset {
    position: relative;
    top: -5rem;
    height: 0;
}
.manual-modal__content table.simple {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 1rem;
}
.manual-modal__content table.simple th,
.manual-modal__content table.simple td {
    border: 1px solid #d0dff0;
    padding: 0.55rem 0.75rem;
    text-align: left;
}
.manual-modal__content table.simple thead th {
    background: #eef3ff;
    color: #0a5bb5;
    font-weight: 700;
    border-color: #b8d0f5;
}
.manual-modal__content table.simple tbody tr:hover {
    background: #eef5ff;
}
.manual-modal__content .manual-toc {
    margin: 1.25rem 0 1.75rem;
    padding: 0.9rem 1.25rem;
    background: #f0f7ff;
    border: 1px solid #cce0ff;
    border-radius: 0.5rem;
}
.manual-modal__content .manual-toc__label {
    margin: 0 0 0.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #0175d8;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.manual-modal__content .manual-toc__list {
    margin: 0;
    padding-left: 1.25rem;
    list-style: decimal;
    text-align: left;
}
.manual-modal__content .manual-toc__list li {
    margin: 0.2rem 0;
    text-align: left;
}
.manual-modal__content .manual-toc__list a {
    color: #0175d8;
    font-size: 0.95rem;
    text-decoration: none;
}
.manual-modal__content .manual-toc__list a:hover {
    text-decoration: underline;
}
.manual-modal__content code {
    background: #f4f4f4;
    padding: 0.1em 0.4em;
    border-radius: 3px;
    font-size: 0.9em;
}
@media (max-width: 600px) {
    .manual-modal__content .container {
        max-width: 95%;
    }
}