.thought-content {
    overflow: visible;
}

:root {
    --primary: #4e6cf2;
    --primary-hover: #3c53d6;
    --text: #333;
    --bg: #f5f7fa;
    --card-bg: #fff;
    --border: #e2e8f0;
    --radius: 8px;
    --transition: all 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-weight: normal;
    font-size: 14px;
    letter-spacing: 0.02em;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
}

::-webkit-scrollbar {
    display: none;
}

body,
* {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.container {
    max-width: 3800px;
    margin: 0 auto;
    padding: 8px;
    padding-bottom: 120px;
}

.composer {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 8px;
    border: none;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

input[type="text"] {
    width: 100%;
    padding: 0.5rem 0.75rem;
    border: none;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 14px;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
}

#thoughts {
    max-width: 500px;
    margin: 0 auto;
    padding-top: 6px;
    max-height: calc(100vh - 175px);
    overflow-y: auto;
}

.info-widget {
    max-width: 500px;
    margin: 8px auto;
    padding: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-size: 13px;
    line-height: 1.4;
}

.info-widget .widget-title {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 14px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
}

.info-widget .widget-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.info-widget .widget-item {
    padding: 6px 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid var(--primary);
}

.info-widget .widget-label {
    font-size: 11px;
    color: #666;
    margin-bottom: 2px;
}

.info-widget .widget-value {
    font-weight: bold;
    color: var(--text);
}

.widget-charts {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chart-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px;
    border: 1px solid var(--border);
}

.chart-title {
    font-weight: bold;
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 13px;
}

.chart-container canvas {
    width: 100% !important;
    height: 200px !important;
}

@media (max-width: 600px) {
    .widget-charts {
        gap: 12px;
    }

    .chart-container {
        padding: 8px;
    }

    .chart-container canvas {
        height: 150px !important;
    }
}

.thought {
    position: relative;
    padding: 12px;
    border-radius: var(--radius);
    background: var(--card-bg);
    border: none;
    margin-bottom: 8px;
    transition: var(--transition);
}

.thought:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.timestamp {
    position: absolute;
    right: 8px;
    bottom: 8px;
    font-size: 0.7rem;
    color: #9ca3af;
}

.highlight {
    background: #aaffaa;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

@keyframes rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.logo {
    font-size: 5rem;
    font-weight: bold;
    color: #ffffff;
    animation: glow 2s ease-in-out infinite alternate;
    z-index: 1;
    letter-spacing: 0.1em;
    text-shadow: 0 0 20px rgba(78, 108, 242, 0.5);
}

.subtitle {
    margin-top: 1.5rem;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    opacity: 0.8;
    z-index: 1;
    letter-spacing: 0.2em;
    transform: translateY(0);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

@keyframes glow {
    from {
        text-shadow: 0 0 20px rgba(78, 108, 242, 0.5),
            0 0 30px rgba(78, 108, 242, 0.5),
            0 0 40px rgba(78, 108, 242, 0.5);
    }

    to {
        text-shadow: 0 0 30px rgba(78, 108, 242, 0.8),
            0 0 40px rgba(78, 108, 242, 0.8),
            0 0 50px rgba(78, 108, 242, 0.8);
    }
}

#calendar-footer {
    width: 100vw;
    background: #f8f9fa;
    border-top: 1px solid #e2e8f0;
    padding: 0;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 100;
    display: block;
    height: 233px;
}

.footer-counter-container {
    min-height: 80px;
    box-sizing: border-box;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
    background: #f1f3f4;
    border-bottom: 1px solid #e2e8f0;
    padding: 4px 0;
    display: flex;
    gap: 5px;
    align-items: stretch;
    min-height: 80px;
}

.calendar-footer-calendar {
    align-items: flex-end;
    box-sizing: border-box;
    display: flex;
    height: 100%;
    overflow-x: auto;
    white-space: nowrap;
    width: 100vw;
}

.footer-counter {
    flex: 0 0 120px;
    background: #fff;
    border-radius: 0;
    padding: 2px 6px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 80px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-counter:hover {
    transform: translateY(-2px);
}

.footer-counter.expired {
    opacity: 0.6;
}

.footer-counter-title {
    font-size: 0.9rem;
    font-weight: bold;
    color: #2d3748;
    margin-bottom: 4px;
    line-height: 1.2;
}

.footer-counter-value {
    font-size: 1.1rem;
    font-weight: bold;
    color: #4e6cf2;
    text-align: center;
    margin: 4px 0;
}

.footer-counter-date {
    font-size: 0.75rem;
    color: #718096;
    text-align: center;
}

.calendar-day {
    flex: 0 0 120px;
    width: 120px;
    display: flex;
    flex-direction: column;
    margin: 0 1px;
    background: #fff;
    text-align: left;
    position: relative;
    height: 100%;
    transition: box-shadow 0.2s;
}

.calendar-day.today {
    border: 2px solid #4e6cf2;
    box-shadow: 0 2px 8px rgba(78, 108, 242, 0.08);
}

.calendar-day.holiday {
    background: #ffeaea;
}

.day-date {
    font-size: 13px;
    font-weight: bold;
    margin-bottom: 2px;
}

.day-weekday {
    font-size: 11px;
    color: #888;
    margin-left: 2px;
}

.day-event {
    font-size: 13px;
    letter-spacing: -1px;
    outline: none;
    border: 1px solid transparent;
    border-radius: 3px;
    padding: 2px;
    background: transparent;
    transition: border 0.2s, background 0.2s;
    white-space: pre-wrap;
    word-break: break-all;
}

.mood-1 {
    background-color: #FF6B6B !important;
}

.mood-2 {
    background-color: #FFA07A !important;
}

.mood-3 {
    background-color: #FFD700 !important;
}

.mood-4 {
    background-color: #98FB98 !important;
}

.mood-5 {
    background-color: #87CEEB !important;
}

.backup-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 16px;
}

.backup-btn {
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.backup-btn:hover {
    background: var(--primary-hover);
}

.backup-btn.secondary {
    background: #6c757d;
}

.backup-btn.secondary:hover {
    background: #5a6268;
}

body.full-calendar-active .container,
body.full-calendar-active #calendar-footer {
    display: none !important;
}

#full-calendar-view {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #f5f5f5;
    z-index: 200;
    overflow-y: auto;
    display: none;
}

#full-calendar-main {
    padding: 40px 10px 10px 10px;
}

#full-calendar-view .week {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    margin-bottom: 1px;
}

@media (min-width: 901px) {
    #full-calendar-view .week {
        grid-template-columns: repeat(14, 1fr);
    }
}

#full-calendar-view .day {
    min-height: 140px;
    padding: 4px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    background-color: #FFFFFF;
    position: relative;
    border: 0.5px dotted #cfe1ec6d;
    cursor: pointer;
}

#full-calendar-view .day:hover {
    filter: brightness(0.95);
}

#full-calendar-view .day.today {
    border: 2px solid #2196F3;
    background-color: #e3f2fd39;
}

#full-calendar-view .date {
    font-size: 1.1rem;
    text-align: center;
    color: #797979;
    font-weight: 500;
    cursor: pointer;
}

#full-calendar-view .note-input {
    color: #4f3752;
    width: 100%;
    flex-grow: 1;
    padding: 2px;
    border: none;
    resize: none;
    font-family: inherit;
    line-height: 1.2;
    font-size: 13px;
    background-color: transparent;
}

#full-calendar-view .note-input:focus {
    outline: none;
    background-color: rgba(255, 255, 255, 0.8);
}

#full-calendar-view .holiday-name {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 0.7rem;
    color: red;
    opacity: 0.7;
}

#full-calendar-view .day.holiday {
    background-color: rgba(255, 204, 204, 0.3) !important;
}

#full-calendar-view .day.mood-1 {
    background-color: #FF6B6B !important;
}

#full-calendar-view .day.mood-2 {
    background-color: #FFA07A !important;
}

#full-calendar-view .day.mood-3 {
    background-color: #FFD700 !important;
}

#full-calendar-view .day.mood-4 {
    background-color: #98FB98 !important;
}

#full-calendar-view .day.mood-5 {
    background-color: #87CEEB !important;
}

#full-calendar-view-close {
    position: fixed;
    top: 10px;
    right: 15px;
    z-index: 210;
    background: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 16px;
    line-height: 30px;
    text-align: center;
}

#calendar-pull-tab {
    position: fixed;
    bottom: 233px;
    right: 8px;
    width: 40px;
    height: 20px;
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-bottom: none;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 16px;
    z-index: 101;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
}

#calendar-pull-tab:hover {
    background: #e9ecef;
}

#counter-list {
    display: none;
    max-width: 500px;
    margin: 0 auto 8px auto;
}

#counter-list .counter,
#thoughts .counter {
    display: flex;
    flex-direction: column;
    margin-bottom: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    border-radius: 8px;
    background: #fff;
    padding: 8px;
}

#counter-list .counter-title,
#thoughts .counter-title {
    font-size: 1rem;
    font-weight: bold;
    color: #2d3748;
}

#counter-list .counter-value,
#thoughts .counter-value {
    font-size: 1.2rem;
    font-weight: bold;
}

#counter-list .counter-unit,
#counter-list .counter-note,
#thoughts .counter-unit,
#thoughts .counter-note {
    font-size: 0.85rem;
    color: #718096;
}

#counter-list .counter.expired,
#thoughts .counter.expired {
    opacity: 0.6;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.calendar-container {
    background-color: #fff;
    border-radius: var(--radius);
    padding: 12px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.month-name {
    font-size: 1.2rem;
    font-weight: bold;
}

.nav-button {
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.nav-button:hover {
    background-color: var(--primary-hover);
}

.calendar {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.calendar th {
    padding: 8px;
    font-weight: 600;
    color: #7f8c8d;
    font-size: 0.8rem;
}

.calendar td {
    padding: 8px;
    border: 1px solid var(--border);
    font-size: 0.9rem;
    position: relative;
}

.calendar td.today {
    background-color: #e8f4fc;
    font-weight: bold;
}

.calendar td.completed {
    position: relative;
}

.calendar td.completed::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #27ae60;
    font-size: 1.5rem;
    font-weight: bold;
    z-index: 1;
}

.calendar td.other-month {
    color: #bdc3c7;
}

/* メモエリア用スタイル */
.memo-container {
    display: flex;
    flex-direction: column;
    margin-top: 10px !important;
    margin-bottom: 3px !important;
    align-items: stretch;
    background-color: #fff5e6;
    box-sizing: border-box;
    margin-left: auto;
    margin-right: auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    min-height: 400px;
    max-height: none;
}

.memo-text-box {
    font-family: "BIZ UDGothic", sans-serif;
    width: 100%;
    border-radius: var(--radius);
    border: none;
    outline: 0;
    color: #000;
    background-color: #fff5e6;
    font-size: large;
    line-height: 200%;
    box-sizing: border-box;
    overflow-y: auto;
}

@media (min-width: 1200px) {
    .memo-text-box {
        max-height: calc(100vh - 280px);
    }
}

.memo-markdown-viewer {
    font-family: "BIZ UDGothic", sans-serif;
    width: 100%;
    min-height: 400px;
    max-height: calc(100vh - 300px);
    border: none;
    padding: 5px;
    font-size: large;
    line-height: 200%;
    word-break: break-all;
    display: none;
    background-color: #fff5e6;
    color: #000;
    overflow-y: auto;
    box-sizing: border-box;
}

@media (min-width: 1200px) {
    .memo-markdown-viewer {
        max-height: calc(100vh - 280px);
    }
}

.memo-markdown-viewer h1,
.thought-content h1 {
    font-size: 1.2em;
    font-weight: bold;
    margin: 1.1em 0 0.7em 0;
    line-height: 1.2;
}

.memo-markdown-viewer h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 1em 0 0.6em 0;
    line-height: 1.3;
}

.memo-markdown-viewer ul,
.thought-content ul {
    margin: 1em 0 1em 2em;
    padding-left: 1.5em;
}

.memo-markdown-viewer li,
.thought-content li {
    margin-bottom: 0.4em;
    line-height: 1.8;
}

/* PC広い画面でのレイアウト調整 */
/* main-area横並びレイアウト */
.main-area {
    display: block;
    height: calc(100vh - 140px);
    /* 仮でフッター分を引く */
    overflow-y: auto;
}

.main-content,
.memo-container {
    max-width: 700px;
    width: 100%;
    margin: 0 auto 20px auto;
    box-sizing: border-box;
}

#thoughts,
.info-widget {
    overflow-y: auto;
}

#info-widget {
    margin-bottom: 100px;
}

@media (max-width: 1200px) {

    .main-content,
    .memo-container {
        max-width: 500px;
    }
}

@media (min-width: 1200px) {
    .main-area {
        display: flex;
        flex-direction: row;
        max-height: calc(100vh - 280px);
        height: calc(100vh - 280px);
        align-items: flex-start;
        gap: 32px;
        max-width: 1440px;
        margin: 0 auto;
        padding: 0 24px;
    }

    .main-content,
    .memo-container {
        margin: 0;
    }

    .main-content {
        flex: 1 1 700px;
        max-width: 700px;
        order: 1;
    }

    .memo-container {
        flex: 1 1 700px;
        max-height: calc(100vh - 280px);
        align-self: flex-start;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
        display: flex;
        flex-direction: column;
        order: 2;
        position: sticky;
        top: 20px;
        overflow-y: auto;
    }
}

.memo-container,
#memoTextBox {
    display: none;
}

#memoTextBox {
    min-height: 400px;
    height: calc(100vh - 250px); /* さらに広げる */
    max-height: calc(100vh - 150px); /* 余白を減らす */
    resize: vertical;
    display: block;
}