:root {
    --n2gomi-bg: #ffffff;
    --n2gomi-text: #222222;
    --n2gomi-muted: #6b7280;
    --n2gomi-border: #e5e7eb;
    --n2gomi-soft: #f8fafc;
    --n2gomi-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    --n2gomi-moyasu: #d85a62;
    --n2gomi-plastic: #d8a028;
    --n2gomi-kan-pet: #3f82c4;
    --n2gomi-bin: #4c9a66;
    --n2gomi-shigen: #9a7047;
    --n2gomi-funen: #7b8190;
    --n2gomi-line: #06c755;
    --n2gomi-on-line: #ffffff;
    --n2gomi-link: #2563eb;
    --n2gomi-success: #14804a;
    --n2gomi-error: #b42318;
}

@media (prefers-color-scheme: dark) {
    :root {
        --n2gomi-bg: #1f2329;
        --n2gomi-text: #f4f5f7;
        --n2gomi-muted: #b9c0ca;
        --n2gomi-border: #3a4049;
        --n2gomi-soft: #2a3038;
        --n2gomi-shadow: 0 12px 30px rgba(0, 0, 0, 0.38);
        --n2gomi-moyasu: #f0787f;
        --n2gomi-plastic: #e8b84a;
        --n2gomi-kan-pet: #68a4df;
        --n2gomi-bin: #74ba86;
        --n2gomi-shigen: #c49562;
        --n2gomi-funen: #a6adba;
        --n2gomi-link: #93c5fd;
        --n2gomi-success: #7dd89c;
        --n2gomi-error: #ff9b95;
    }
}

.n2gomi-shortcode-root {
    min-height: 56px;
}

.n2gomi-shell {
    --n2gomi-top: 0px;
    color: var(--n2gomi-text);
    font-family: inherit;
    position: fixed;
    top: var(--n2gomi-top);
    left: 0;
    right: 0;
    z-index: 99980;
    pointer-events: none;
}

.n2gomi-band,
.n2gomi-pill,
.n2gomi-panel {
    box-sizing: border-box;
    font-family: inherit;
    pointer-events: auto;
}

.n2gomi-band {
    align-items: center;
    background: var(--n2gomi-bg);
    border: 0;
    border-bottom: 1px solid var(--n2gomi-border);
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
    color: var(--n2gomi-text);
    cursor: pointer;
    display: flex;
    font-size: 14px;
    font-weight: 700;
    gap: 10px;
    justify-content: center;
    line-height: 1.35;
    min-height: 44px;
    padding: 10px 48px;
    position: absolute;
    top: 0;
    transform: translateY(-110%);
    transition: transform 180ms ease;
    width: 100%;
}

.n2gomi-shell.is-visible .n2gomi-band {
    transform: translateY(0);
}

.n2gomi-shell.is-alert-active .n2gomi-band {
    transform: translateY(-110%);
}

.n2gomi-band-main {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.n2gomi-band-action,
.n2gomi-caret {
    color: var(--n2gomi-muted);
    flex: 0 0 auto;
    font-size: 12px;
}

.n2gomi-band.has-notice::after {
    background: var(--n2gomi-moyasu);
    border-radius: 999px;
    content: "";
    height: 7px;
    margin-left: 2px;
    width: 7px;
}

.n2gomi-pill {
    background: var(--n2gomi-bg);
    border: 1px solid var(--n2gomi-border);
    border-radius: 999px;
    box-shadow: var(--n2gomi-shadow);
    color: var(--n2gomi-text);
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    min-height: 32px;
    opacity: 0;
    padding: 6px 12px;
    position: absolute;
    right: 12px;
    top: 8px;
    transform: translateY(-12px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.n2gomi-shell.is-alert-active .n2gomi-pill {
    opacity: 1;
    transform: translateY(0);
}

.n2gomi-panel {
    background: var(--n2gomi-bg);
    border: 1px solid var(--n2gomi-border);
    border-radius: 0 0 8px 8px;
    box-shadow: var(--n2gomi-shadow);
    left: 50%;
    max-height: calc(100vh - var(--n2gomi-top) - 16px);
    max-width: min(720px, calc(100vw - 20px));
    min-height: 520px;
    overflow: auto;
    position: absolute;
    top: 48px;
    transform: translate(-50%, -120%);
    transition: transform 180ms ease;
    width: 720px;
}

.n2gomi-shell.is-panel-open .n2gomi-panel {
    transform: translate(-50%, 0);
}

.n2gomi-panel-inner {
    display: grid;
    gap: 16px;
    padding: 16px;
}

.n2gomi-panel-head {
    align-items: center;
    display: flex;
    justify-content: space-between;
}

.n2gomi-panel-head strong {
    font-size: 16px;
}

.n2gomi-close {
    align-items: center;
    background: transparent;
    border: 1px solid var(--n2gomi-border);
    border-radius: 999px;
    color: var(--n2gomi-text);
    cursor: pointer;
    display: inline-flex;
    font-size: 18px;
    height: 32px;
    justify-content: center;
    line-height: 1;
    width: 32px;
}

.n2gomi-day-cards,
.n2gomi-months {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.n2gomi-day-card {
    background: var(--n2gomi-soft);
    border: 1px solid var(--n2gomi-border);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    min-height: 112px;
    padding: 12px;
}

.n2gomi-day-card span,
.n2gomi-section h2,
.n2gomi-month h3 {
    color: var(--n2gomi-muted);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
}

.n2gomi-day-card strong {
    font-size: 18px;
}

.n2gomi-section {
    display: grid;
    gap: 10px;
}

.n2gomi-type-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.n2gomi-type {
    align-items: center;
    display: inline-flex;
    font-size: 12px;
    font-weight: 700;
    gap: 5px;
    line-height: 1.3;
}

.n2gomi-type i,
.n2gomi-dot {
    background: var(--n2gomi-funen);
    border-radius: 999px;
    display: inline-block;
    flex: 0 0 auto;
    height: 8px;
    width: 8px;
}

.n2gomi-type-moyasu i,
.n2gomi-dot-moyasu {
    background: var(--n2gomi-moyasu);
}

.n2gomi-type-plastic i,
.n2gomi-dot-plastic {
    background: var(--n2gomi-plastic);
}

.n2gomi-type-kan_pet i,
.n2gomi-dot-kan_pet {
    background: var(--n2gomi-kan-pet);
}

.n2gomi-type-bin i,
.n2gomi-dot-bin {
    background: var(--n2gomi-bin);
}

.n2gomi-type-shigen i,
.n2gomi-dot-shigen {
    background: var(--n2gomi-shigen);
}

.n2gomi-type-funen i,
.n2gomi-dot-funen {
    background: var(--n2gomi-funen);
}

.n2gomi-next-list,
.n2gomi-exceptions {
    display: grid;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.n2gomi-next-list li,
.n2gomi-exceptions li {
    align-items: center;
    border-bottom: 1px solid var(--n2gomi-border);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    min-height: 36px;
    padding: 6px 0;
}

.n2gomi-exceptions li {
    align-items: flex-start;
    display: grid;
    gap: 3px;
    justify-content: stretch;
}

.n2gomi-exceptions a {
    color: inherit;
    font-weight: 700;
}

.n2gomi-exceptions small,
.n2gomi-muted,
.n2gomi-form-message {
    color: var(--n2gomi-muted);
    font-size: 12px;
    margin: 0;
}

.n2gomi-month {
    display: grid;
    gap: 8px;
}

.n2gomi-weekdays,
.n2gomi-calendar {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.n2gomi-weekdays span {
    color: var(--n2gomi-muted);
    font-size: 11px;
    text-align: center;
}

.n2gomi-calendar {
    border-left: 1px solid var(--n2gomi-border);
    border-top: 1px solid var(--n2gomi-border);
}

.n2gomi-cal-cell {
    aspect-ratio: 1;
    border-bottom: 1px solid var(--n2gomi-border);
    border-right: 1px solid var(--n2gomi-border);
    display: grid;
    gap: 2px;
    grid-template-rows: auto 1fr;
    min-height: 38px;
    padding: 4px;
}

.n2gomi-cal-cell.is-empty {
    background: var(--n2gomi-soft);
}

.n2gomi-cal-cell.is-today {
    outline: 2px solid var(--n2gomi-kan-pet);
    outline-offset: -2px;
}

.n2gomi-cal-cell span {
    font-size: 11px;
    line-height: 1;
}

.n2gomi-cal-cell b {
    align-content: start;
    display: flex;
    flex-wrap: wrap;
    gap: 2px;
}

.n2gomi-dot {
    height: 6px;
    width: 6px;
}

.n2gomi-member-note,
.n2gomi-upgrade-card {
    background: var(--n2gomi-soft);
    border: 1px solid var(--n2gomi-border);
    border-radius: 8px;
    padding: 12px;
}

.n2gomi-member-note {
    color: var(--n2gomi-muted);
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
}

.n2gomi-upgrade-card {
    display: grid;
    gap: 10px;
}

.n2gomi-upgrade-card h2 {
    color: var(--n2gomi-text);
    font-size: 15px;
    line-height: 1.4;
    margin: 0;
}

.n2gomi-upgrade-list {
    display: grid;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.n2gomi-upgrade-list li {
    color: var(--n2gomi-text);
    font-size: 13px;
    line-height: 1.55;
}

.n2gomi-upgrade-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.n2gomi-line-save,
.n2gomi-email-submit {
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 700;
    min-height: 38px;
    padding: 8px 14px;
}

.n2gomi-line-save {
    background: var(--n2gomi-line);
    color: var(--n2gomi-on-line);
}

.n2gomi-mail-save {
    background: transparent;
    border: 0;
    color: var(--n2gomi-link);
    cursor: pointer;
    font-weight: 700;
    min-height: 36px;
    padding: 6px 0;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.n2gomi-line-save:disabled,
.n2gomi-mail-save:disabled,
.n2gomi-email-submit:disabled {
    cursor: wait;
    opacity: 0.58;
}

.n2gomi-email-form {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.n2gomi-email-form label {
    color: var(--n2gomi-muted);
    display: grid;
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
}

.n2gomi-email-form input {
    background: var(--n2gomi-bg);
    border: 1px solid var(--n2gomi-border);
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--n2gomi-text);
    font: inherit;
    min-height: 40px;
    padding: 8px 10px;
    width: 100%;
}

.n2gomi-email-submit {
    background: var(--n2gomi-text);
    color: var(--n2gomi-bg);
}

.n2gomi-upgrade-message {
    color: var(--n2gomi-muted);
    font-size: 12px;
    line-height: 1.5;
    margin: 0;
}

.n2gomi-upgrade-message.is-success {
    color: var(--n2gomi-success);
}

.n2gomi-upgrade-message.is-error {
    color: var(--n2gomi-error);
}

.n2gomi-policy-link {
    color: var(--n2gomi-muted);
    font-size: 12px;
    justify-self: start;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.n2gomi-change-town,
.n2gomi-submit {
    background: var(--n2gomi-text);
    border: 0;
    border-radius: 6px;
    color: var(--n2gomi-bg);
    cursor: pointer;
    font-weight: 700;
    min-height: 40px;
    padding: 9px 14px;
}

.n2gomi-submit:disabled {
    cursor: not-allowed;
    opacity: 0.42;
}

.n2gomi-town-form {
    display: grid;
    gap: 12px;
}

.n2gomi-town-form label {
    color: var(--n2gomi-muted);
    display: grid;
    font-size: 12px;
    font-weight: 700;
    gap: 6px;
}

.n2gomi-town-form input,
.n2gomi-town-form select {
    background: var(--n2gomi-bg);
    border: 1px solid var(--n2gomi-border);
    border-radius: 6px;
    box-sizing: border-box;
    color: var(--n2gomi-text);
    font: inherit;
    min-height: 42px;
    padding: 8px 10px;
    width: 100%;
}

@media (max-width: 640px) {
    .n2gomi-band {
        font-size: 13px;
        justify-content: flex-start;
        padding: 10px 14px;
    }

    .n2gomi-panel {
        border-radius: 0;
        left: 0;
        max-height: calc(100vh - var(--n2gomi-top));
        max-width: 100vw;
        min-height: 560px;
        top: 44px;
        transform: translateY(-120%);
        width: 100vw;
    }

    .n2gomi-shell.is-panel-open .n2gomi-panel {
        transform: translateY(0);
    }

    .n2gomi-day-cards,
    .n2gomi-months {
        grid-template-columns: 1fr;
    }

    .n2gomi-email-form {
        align-items: stretch;
        grid-template-columns: 1fr;
    }
}
