:root {
    --bg: #ece6dd;
    --bg-soft: #f6f1ea;
    --bg-deep: #56524d;
    --card: rgba(255, 251, 246, 0.94);
    --card-strong: #fbf7f1;
    --text: #302d29;
    --muted: #756d65;
    --border: rgba(96, 88, 79, 0.12);
    --border-strong: rgba(96, 88, 79, 0.2);
    --primary: #665d53;
    --primary-dark: #4c453e;
    --danger: #8d3e35;
    --danger-bg: #f4dfdb;
    --tag-bg: #e2ddd5;
    --tag-text: #514a43;
    --radius: 18px;
    --radius-lg: 30px;
    --shadow: 0 24px 50px rgba(40, 34, 28, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Avenir Next", "Hiragino Sans", "Yu Gothic", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top center, rgba(255, 255, 255, 0.58), rgba(255, 255, 255, 0) 42%),
        linear-gradient(180deg, #f3eee8 0%, var(--bg) 100%);
    line-height: 1.7;
    letter-spacing: 0.01em;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: none;
}

.container {
    width: min(1080px, calc(100% - 32px));
    margin-inline: auto;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(86, 82, 77, 0.9);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 84px;
    padding: 8px 0;
}

.site-logo {
    color: #f4efe7;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.08em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 14px 18px;
}

.site-nav a {
    color: rgba(244, 239, 231, 0.84);
    font-size: 0.94rem;
    position: relative;
}

.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 1px;
    background: rgba(244, 239, 231, 0.55);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.22s ease;
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
    transform: scaleX(1);
}

main {
    padding: 30px 0 52px;
}

.archive-hero {
    margin-bottom: 24px;
    padding: 28px;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: var(--radius-lg);
    background:
        linear-gradient(135deg, rgba(252, 248, 243, 0.94), rgba(241, 235, 226, 0.86)),
        var(--card-strong);
    box-shadow: var(--shadow);
}

.archive-toolbar {
    margin: -4px 0 20px;
    color: var(--muted);
    font-size: 0.94rem;
}

.archive-kicker {
    margin: 0 0 14px;
    color: var(--muted);
    font-size: 0.86rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-title {
    margin: 0 0 10px;
    font-size: clamp(1.65rem, 2.6vw, 2.35rem);
    line-height: 1.22;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.archive-hero .page-title {
    font-size: clamp(2rem, 4.2vw, 2.9rem);
}

.page-subtitle {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
}

.panel,
.tool-card,
.content-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    backdrop-filter: blur(8px);
}

.panel {
    padding: 20px;
    margin-bottom: 22px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 780px) {
    .form-grid {
        grid-template-columns: 2fr 1fr 1fr auto;
        align-items: end;
    }
}

.field label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--muted);
}

.field-help {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.88rem;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    border: 1px solid rgba(85, 79, 73, 0.18);
    border-radius: 14px;
    padding: 12px 14px;
    font: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.6);
    transition: border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
input[type="datetime-local"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: rgba(88, 80, 70, 0.45);
    background: rgba(255, 255, 255, 0.82);
    box-shadow: 0 0 0 4px rgba(88, 80, 70, 0.08);
}

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

textarea[readonly] {
    background: rgba(245, 241, 234, 0.9);
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.time-form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

@media (min-width: 860px) {
    .time-form-grid {
        grid-template-columns: 1.3fr 1fr 1fr;
    }
}

.field-datetime {
    padding: 18px;
    border: 1px solid rgba(96, 88, 79, 0.14);
    border-radius: 18px;
    background: linear-gradient(135deg, rgba(255, 250, 244, 0.92), rgba(247, 240, 231, 0.84));
}

.field-datetime label {
    font-size: 1rem;
    color: var(--text);
}

.field-datetime input[type="datetime-local"] {
    min-height: 60px;
    padding: 14px 16px;
    font-size: 1.15rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.9);
}

.timezone-card {
    padding: 24px;
}

.timezone-heading {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 18px;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    color: #4c5f74;
}

.timezone-heading::before {
    content: "";
    width: 12px;
    height: 58px;
    border-radius: 0;
    background: #a8d01d;
    flex: none;
}

.date-segment-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 12px;
    overflow: hidden;
    border-radius: 10px;
    border: 1px solid #d3cfc8;
}

.date-segment {
    display: grid;
    grid-template-columns: 1fr 122px;
    background: #fff;
    border-right: 1px solid #d3cfc8;
}

.date-segment:last-child {
    border-right: 0;
}

.date-segment input {
    min-width: 0;
    border: 0;
    border-radius: 0;
    min-height: 96px;
    padding: 18px 14px;
    font-size: clamp(1.6rem, 4vw, 2.2rem);
    font-weight: 600;
    text-align: center;
    background: #fff;
    box-shadow: none;
}

.date-segment input:focus {
    box-shadow: inset 0 0 0 3px rgba(59, 119, 176, 0.18);
}

.date-segment span {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #8a8887;
    color: #fff;
    font-size: clamp(1.25rem, 3vw, 1.7rem);
    font-weight: 700;
}

.timezone-select-stack {
    display: grid;
    gap: 8px;
}

.timezone-select-row {
    display: grid;
    grid-template-columns: 1fr 124px;
    align-items: stretch;
    overflow: hidden;
    border: 1px solid #d3cfc8;
    border-radius: 8px;
    background: #fff;
}

.timezone-select-input {
    border: 0;
    border-radius: 0;
    min-height: 96px;
    padding: 18px 20px;
    font-size: clamp(1.1rem, 2.6vw, 1.65rem);
    font-weight: 600;
    background: #fff;
    box-shadow: none;
}

.timezone-select-input:focus {
    box-shadow: inset 0 0 0 3px rgba(59, 119, 176, 0.18);
}

.timezone-postfix {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    font-weight: 700;
}

.timezone-postfix-from {
    background: #3c6f9f;
}

.timezone-postfix-to {
    background: #f16062;
}

.timezone-note {
    margin: 10px 0 0;
    color: #7f7871;
    font-size: 0.95rem;
}

.timezone-actions {
    margin-top: 14px;
}

.btn-convert-large {
    width: 100%;
    min-height: 96px;
    margin-top: 8px;
    border-radius: 10px;
    background: linear-gradient(180deg, #ff9d1a, #ff8300);
    box-shadow: inset 0 -6px 0 rgba(255, 72, 0, 0.72);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
}

.btn-convert-large:hover,
.btn-convert-large:focus-visible {
    background: linear-gradient(180deg, #ffac3c, #ff8d13);
}

.action-group + .action-group {
    margin-top: 18px;
}

.action-label {
    margin: 16px 0 0;
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tooltip-wrap {
    position: relative;
    display: inline-flex;
}

.tooltip-wrap::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 50%;
    bottom: calc(100% + 12px);
    width: min(320px, 72vw);
    padding: 10px 12px;
    border-radius: 12px;
    background: rgba(63, 57, 51, 0.96);
    color: #f8f4ee;
    font-size: 0.8rem;
    line-height: 1.55;
    text-align: left;
    box-shadow: 0 18px 36px rgba(32, 27, 22, 0.18);
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, 6px);
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 20;
}

.tooltip-wrap::before {
    content: "";
    position: absolute;
    left: 50%;
    bottom: calc(100% + 4px);
    width: 10px;
    height: 10px;
    background: rgba(63, 57, 51, 0.96);
    transform: translateX(-50%) rotate(45deg);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease;
    z-index: 19;
}

.tooltip-wrap:hover::after,
.tooltip-wrap:hover::before,
.tooltip-wrap:focus-visible::after,
.tooltip-wrap:focus-visible::before,
.tooltip-wrap:focus-within::after,
.tooltip-wrap:focus-within::before {
    opacity: 1;
    transform: translate(-50%, 0);
}

.tooltip-wrap:hover::before,
.tooltip-wrap:focus-visible::before,
.tooltip-wrap:focus-within::before {
    transform: translateX(-50%) rotate(45deg);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    background: var(--primary);
    color: #f7f3ee;
    border-radius: 999px;
    padding: 11px 16px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.btn:hover,
.btn:focus-visible {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.58);
    color: var(--text);
    border-color: rgba(85, 79, 73, 0.18);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: rgba(255, 255, 255, 0.82);
}

.btn-danger {
    background: #7c433c;
}

.btn-danger:hover,
.btn-danger:focus-visible {
    background: #62332d;
}

.btn-lower {
    background: #6e7d74;
}

.btn-lower:hover,
.btn-lower:focus-visible {
    background: #55635b;
}

.btn-upper {
    background: #8a6955;
}

.btn-upper:hover,
.btn-upper:focus-visible {
    background: #6f5342;
}

.btn-toggle {
    background: #6f6479;
}

.btn-toggle:hover,
.btn-toggle:focus-visible {
    background: #584f61;
}

.btn-title {
    background: #857258;
}

.btn-title:hover,
.btn-title:focus-visible {
    background: #6b5b46;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.tool-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
    color: inherit;
    position: relative;
    overflow: hidden;
    cursor: pointer;
    border-color: color-mix(in srgb, var(--tool-accent, var(--primary)) 24%, white);
}

.tool-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 6px;
    height: auto;
    background: var(--tool-accent, var(--primary));
}

.tool-card:hover,
.tool-card:focus-visible {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--tool-accent, var(--primary)) 35%, white);
}

.tool-card.is-dragging {
    opacity: 0.72;
    transform: scale(0.98);
}

.tool-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.tool-card-category {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 700;
    background: color-mix(in srgb, var(--tool-accent, var(--primary)) 12%, white);
    color: color-mix(in srgb, var(--tool-accent, var(--primary)) 82%, black 18%);
}

.tool-drag-handle {
    border: 1px dashed color-mix(in srgb, var(--tool-accent, var(--primary)) 46%, white);
    background: rgba(255, 255, 255, 0.72);
    color: var(--text);
    border-radius: 999px;
    padding: 7px 10px;
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: grab;
}

.tool-drag-handle:active {
    cursor: grabbing;
}

.tool-card h2,
.tool-card h3 {
    margin: 0 0 8px;
    font-size: 1.12rem;
    font-weight: 600;
}

.tool-card p {
    margin: 0;
}

.tool-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.tool-card-hint {
    color: var(--muted);
    font-size: 0.78rem;
}

.meta-line {
    color: var(--muted);
    font-size: 0.88rem;
    margin: 10px 0 0;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 16px;
    padding: 0;
    list-style: none;
}

.tag {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--tag-bg);
    color: var(--tag-text);
    font-size: 0.78rem;
    font-weight: 600;
}

.error-box {
    border: 1px solid #d8aba4;
    background: var(--danger-bg);
    color: var(--danger);
    border-radius: 14px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.split-panels {
    display: grid;
    gap: 14px;
}

@media (min-width: 880px) {
    .split-panels {
        grid-template-columns: 1fr 1fr;
    }
}

.content-card {
    padding: 22px;
    margin-top: 18px;
}

.content-card h2 {
    margin-top: 0;
    margin-bottom: 12px;
    font-size: 1.2rem;
    font-weight: 600;
}

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

.result-card,
.city-clock-card {
    background: rgba(255, 251, 246, 0.84);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 18px;
    box-shadow: var(--shadow);
}

.result-card-accent {
    background: linear-gradient(135deg, rgba(255, 248, 240, 0.96), rgba(246, 238, 226, 0.92));
}

.result-label {
    margin: 0 0 8px;
    color: var(--muted);
    font-size: 0.82rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.result-card h2 {
    margin: 0 0 8px;
}

.result-time,
.city-clock-time {
    font-size: clamp(1.4rem, 3vw, 2rem);
    line-height: 1.15;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.city-clock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
}

.faq-item + .faq-item {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px dashed rgba(85, 79, 73, 0.2);
}

.tools-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.tools-inline a {
    display: inline-block;
    border: 1px solid rgba(85, 79, 73, 0.16);
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.5);
    color: var(--text);
    transition: background-color 0.18s ease, transform 0.18s ease;
}

.tools-inline a:hover,
.tools-inline a:focus-visible {
    background: rgba(255, 255, 255, 0.82);
    transform: translateY(-1px);
}

.site-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(86, 82, 77, 0.95);
    color: rgba(244, 239, 231, 0.72);
    padding: 18px 0 22px;
}

.site-footer small {
    letter-spacing: 0.04em;
}

.tool-detail-page .page-title {
    color: var(--page-accent, var(--text));
}

.tool-detail-page .content-card,
.tool-detail-page .panel {
    border-top: 4px solid color-mix(in srgb, var(--page-accent, var(--primary)) 68%, white);
}

.toast-wrap {
    position: fixed;
    right: 16px;
    bottom: 16px;
    display: grid;
    gap: 8px;
    z-index: 1000;
}

.toast {
    min-width: 220px;
    max-width: 340px;
    background: #3f3933;
    color: #fff;
    border-radius: 14px;
    padding: 11px 13px;
    box-shadow: var(--shadow);
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-show {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    background: #7a342d;
}

.btn-theme {
    background: var(--tool-accent, var(--primary));
}

.btn-theme:hover,
.btn-theme:focus-visible {
    background: color-mix(in srgb, var(--tool-accent, var(--primary)) 84%, black);
}

.schedule-intro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
}

.schedule-intro-card {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.52);
}

.schedule-intro-card h2 {
    margin-top: 0;
    font-size: 1.02rem;
}

.schedule-shell {
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(248, 244, 238, 0.92)),
        var(--card);
}

.schedule-section-head {
    margin-bottom: 18px;
}

.schedule-section-head h2 {
    margin: 0 0 8px;
}

.schedule-section-head p {
    margin: 0;
    color: var(--muted);
}

.schedule-candidate-input {
    min-height: 220px;
}

.btn-schedule {
    background: linear-gradient(135deg, #f08b2f, #f36f2a);
    box-shadow: inset 0 -3px 0 rgba(160, 69, 20, 0.18);
}

.btn-schedule:hover,
.btn-schedule:focus-visible {
    background: linear-gradient(135deg, #e27f23, #e8621d);
}

.schedule-share-box {
    padding: 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.58);
}

.schedule-share-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: center;
}

.schedule-summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 18px 0;
}

.schedule-summary-card {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid var(--border);
}

.schedule-score-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    color: var(--muted);
    font-weight: 700;
}

.schedule-vote-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

@media (min-width: 980px) {
    .schedule-vote-layout {
        grid-template-columns: 1.05fr 1fr;
    }
}

.schedule-answer-list {
    display: grid;
    gap: 12px;
}

.schedule-answer-row {
    padding: 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.62);
    border: 1px solid var(--border);
}

.schedule-answer-row p {
    margin: 0 0 12px;
    font-weight: 700;
}

.schedule-answer-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.schedule-answer-option {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(250, 246, 240, 0.92);
    border: 1px solid var(--border);
}

.schedule-response-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.74);
}

.schedule-response-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 620px;
}

.schedule-response-table th,
.schedule-response-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(96, 88, 79, 0.08);
    text-align: left;
    vertical-align: top;
}

.schedule-response-table th {
    background: rgba(245, 239, 232, 0.9);
    font-size: 0.88rem;
}

code {
    font-family: "SFMono-Regular", "Menlo", "Consolas", monospace;
    font-size: 0.92em;
    background: rgba(84, 78, 71, 0.08);
    padding: 0.15em 0.4em;
    border-radius: 8px;
}

@media (max-width: 720px) {
    .header-inner {
        min-height: 74px;
    }

    .site-nav {
        gap: 8px 14px;
    }

    .archive-hero,
    .panel,
    .content-card,
    .tool-card {
        border-radius: 20px;
    }

    .archive-hero {
        padding: 24px 20px;
    }

    .page-title {
        font-size: clamp(1.45rem, 7vw, 1.95rem);
    }

    .archive-hero .page-title {
        font-size: clamp(1.9rem, 8vw, 2.35rem);
    }

    .date-segment-grid {
        grid-template-columns: 1fr;
        gap: 6px;
        border: 0;
        overflow: visible;
    }

    .date-segment {
        border: 1px solid #d3cfc8;
        border-radius: 10px;
    }

    .timezone-select-row {
        grid-template-columns: 1fr 82px;
    }

    .btn,
    .tools-inline a {
        width: 100%;
    }

    .button-row {
        display: grid;
        grid-template-columns: 1fr;
    }
}
