/* Auto jin Tools - life & calculator tools stylesheet.
 * Loaded after tool-site.css and batch-kit.css.
 */

/* Common Layout & Helpers */
.life-tool-app { display: grid; gap: 20px; width: 100%; }
.life-card { padding: 18px; border: 1px solid var(--tool-border); border-radius: 14px; background: #ffffff; }
.life-card-title { margin: 0 0 12px; font-size: 1rem; font-weight: 800; color: var(--tool-ink); }
.life-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 10px; }
.life-stat-box { padding: 14px; border: 1px solid var(--tool-border); border-radius: 12px; background: #fbfcfe; text-align: center; }
.life-stat-box strong { display: block; font-size: 1.3rem; font-weight: 800; color: var(--tool-brand-dark); line-height: 1.2; }
.life-stat-box span { display: block; margin-top: 4px; font-size: 0.76rem; color: var(--tool-muted); }

/* Unit Converter */
.unit-results-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; margin-top: 14px; }
.unit-result-card { display: flex; flex-direction: column; justify-content: space-between; padding: 12px 14px; border: 1px solid var(--tool-border); border-radius: 10px; background: #ffffff; cursor: pointer; transition: border-color 0.15s, box-shadow 0.15s; }
.unit-result-card:hover { border-color: var(--tool-brand); box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.unit-result-card.is-active { border-color: var(--tool-brand); background: #fffaf7; }
.unit-result-label { font-size: 0.78rem; color: var(--tool-muted); font-weight: 600; }
.unit-result-val { font-size: 1.05rem; font-weight: 800; color: var(--tool-ink); margin-top: 4px; word-break: break-all; }
.unit-result-copy-hint { font-size: 0.7rem; color: var(--tool-brand); margin-top: 4px; opacity: 0; transition: opacity 0.15s; }
.unit-result-card:hover .unit-result-copy-hint { opacity: 1; }

/* Date Calculator & D-Day */
.dday-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 54px; padding: 3px 8px; border-radius: 999px; font-size: 0.74rem; font-weight: 800; }
.dday-badge.is-today { background: #ffe5dd; color: #d94d32; border: 1px solid #fca58e; }
.dday-badge.is-future { background: #e0f2fe; color: #0284c7; }
.dday-badge.is-past { background: #f3f4f6; color: #6b7280; }
.date-highlight-card { padding: 16px; border-radius: 12px; background: #f4f7fb; border: 1px solid #d9e2ec; margin-top: 10px; }
.date-highlight-val { font-size: 1.35rem; font-weight: 800; color: var(--tool-ink); }
.date-sub-info { font-size: 0.85rem; color: var(--tool-muted); margin-top: 4px; }

/* Age & D-Day */
.zodiac-badge { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 8px; background: #fef3c7; color: #92400e; font-size: 0.82rem; font-weight: 700; }

/* Compound Interest */
.compound-chart-wrap { width: 100%; overflow-x: auto; background: #ffffff; border: 1px solid var(--tool-border); border-radius: 14px; padding: 16px; margin-top: 14px; }
.compound-chart-svg { width: 100%; min-width: 480px; height: 260px; display: block; }

/* Focus Timer */
.focus-timer-box { display: grid; place-items: center; gap: 16px; padding: 32px 20px; border-radius: 18px; background: var(--tool-navy); color: #ffffff; text-align: center; }
.focus-timer-mode { font-size: 0.95rem; font-weight: 700; letter-spacing: 0.05em; color: var(--tool-lime); text-transform: uppercase; }
.focus-timer-clock { font: 800 clamp(3.2rem, 12vw, 6rem)/1 Outfit, sans-serif; letter-spacing: 0.03em; }
.focus-timer-controls { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 8px; }
.focus-session-pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 999px; background: rgba(255,255,255,0.12); font-size: 0.82rem; color: #e2e8f0; }

/* Meeting Timer */
.meeting-timer-box { padding: 24px; border-radius: 16px; background: var(--tool-navy); color: #ffffff; text-align: center; }
.meeting-current-name { font-size: 1.15rem; font-weight: 800; color: #ffffff; margin-bottom: 6px; }
.meeting-timer-clock { font: 800 clamp(2.8rem, 10vw, 5rem)/1 Outfit, sans-serif; letter-spacing: 0.02em; margin: 10px 0; }
.meeting-timer-clock.is-overtime { color: #f87171; text-shadow: 0 0 12px rgba(239, 68, 68, 0.4); }
.meeting-total-time { font-size: 0.86rem; color: #cbd5e1; }
.meeting-agenda-list { display: grid; gap: 8px; margin: 16px 0 0; padding: 0; list-style: none; }
.meeting-agenda-item { display: grid; grid-template-columns: auto 1fr auto auto; gap: 10px; align-items: center; padding: 10px 14px; border: 1px solid var(--tool-border); border-radius: 10px; background: #ffffff; font-size: 0.88rem; }
.meeting-agenda-item.is-current { border-color: var(--tool-brand); background: #fffaf7; box-shadow: 0 0 0 2px rgba(245,107,76,0.2); }
.meeting-agenda-item.is-done { opacity: 0.6; background: #f8fafc; }
.meeting-agenda-item.is-done .agenda-name { text-decoration: line-through; }
.agenda-num { font-weight: 800; color: var(--tool-muted); font-size: 0.8rem; width: 20px; }
.agenda-name { font-weight: 700; color: var(--tool-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agenda-time { font-weight: 700; color: var(--tool-muted); font-size: 0.82rem; }
.agenda-actions { display: flex; gap: 4px; }
.agenda-actions button { border: 1px solid var(--tool-border); background: #ffffff; border-radius: 6px; padding: 4px 8px; font-size: 0.75rem; cursor: pointer; }
.agenda-actions button:hover { background: #f1f5f9; }

/* Checklist & Todo List */
.check-progress-bar { width: 100%; height: 8px; border-radius: 999px; background: #e2e8f0; overflow: hidden; margin-top: 6px; }
.check-progress-fill { height: 100%; background: var(--tool-brand); transition: width 0.2s ease; }
.todo-priority-badge { display: inline-flex; padding: 2px 7px; border-radius: 6px; font-size: 0.72rem; font-weight: 800; }
.todo-priority-badge.p-high { background: #fee2e2; color: #dc2626; }
.todo-priority-badge.p-med { background: #fef3c7; color: #d97706; }
.todo-priority-badge.p-low { background: #f1f5f9; color: #64748b; }
.todo-due-tag { font-size: 0.74rem; color: var(--tool-muted); }
.todo-due-tag.is-overdue { color: #dc2626; font-weight: 700; }
.list-item-drag-btn { cursor: move; color: var(--tool-muted); font-size: 0.9rem; padding: 0 4px; user-select: none; }
.list-item-edit-input { flex: 1; min-width: 0; padding: 4px 8px; border: 1px solid var(--tool-brand); border-radius: 6px; font: inherit; font-size: 0.88rem; }

/* Quick Memo */
.memo-container { display: grid; grid-template-columns: 260px 1fr; gap: 16px; min-height: 480px; }
.memo-sidebar { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--tool-border); border-radius: 12px; padding: 12px; background: #ffffff; max-height: 600px; overflow-y: auto; }
.memo-search-input { width: 100%; padding: 8px 12px; border: 1px solid var(--tool-border); border-radius: 8px; font-size: 0.82rem; }
.memo-list { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.memo-list-item { padding: 10px 12px; border: 1px solid var(--tool-border); border-radius: 8px; background: #fbfcfe; cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.memo-list-item:hover { border-color: #cbd5e1; background: #f1f5f9; }
.memo-list-item.is-active { border-color: var(--tool-brand); background: #fffaf7; }
.memo-list-title { font-size: 0.86rem; font-weight: 700; color: var(--tool-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.memo-list-date { font-size: 0.72rem; color: var(--tool-muted); margin-top: 3px; }
.memo-editor { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--tool-border); border-radius: 12px; padding: 16px; background: #ffffff; }
.memo-title-input { font-size: 1.1rem; font-weight: 800; border: 1px solid var(--tool-border); border-radius: 8px; padding: 10px 12px; width: 100%; }
.memo-body-textarea { flex: 1; min-height: 320px; font: inherit; font-size: 0.92rem; line-height: 1.65; border: 1px solid var(--tool-border); border-radius: 8px; padding: 12px; resize: vertical; }
.memo-status-indicator { font-size: 0.76rem; color: var(--tool-muted); }

/* Annual Calendar */
.calendar-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.calendar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.month-card { border: 1px solid var(--tool-border); border-radius: 12px; padding: 12px; background: #ffffff; }
.month-title { font-size: 0.95rem; font-weight: 800; margin: 0 0 8px; text-align: center; color: var(--tool-ink); }
.cal-table { width: 100%; border-collapse: collapse; text-align: center; font-size: 0.78rem; table-layout: fixed; }
.cal-table th { padding: 4px 0; color: var(--tool-muted); font-size: 0.72rem; font-weight: 700; }
.cal-table td { padding: 4px 0; min-height: 24px; position: relative; }
.cal-table .sun, .cal-table th.sun-head { color: #dc2626; }
.cal-table .sat, .cal-table th.sat-head { color: #2563eb; }
.cal-table .holiday { color: #dc2626; font-weight: 800; }
.cal-cell-inner { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; }
.cal-table .today .cal-cell-inner { background: var(--tool-brand); color: #ffffff !important; font-weight: 800; }
.cal-table .holiday-tag { display: block; font-size: 0.6rem; color: #dc2626; transform: scale(0.85); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; line-height: 1; }

/* Mindmap */
.mindmap-viewport { width: 100%; min-height: 520px; overflow: auto; border: 1px solid var(--tool-border); border-radius: 14px; background: #f8fafc; display: grid; place-items: center; padding: 10px; }
.mindmap-svg { max-width: 100%; height: auto; display: block; }

/* Mandalart 9x9 */
.mandalart-scroll-wrap { width: 100%; overflow-x: auto; padding: 4px; -webkit-overflow-scrolling: touch; }
.mandalart-board { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; min-width: 680px; max-width: 860px; margin: 0 auto; background: #e2e8f0; padding: 8px; border-radius: 14px; border: 2px solid #cbd5e1; }
.mandalart-block { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #ffffff; padding: 6px; border-radius: 10px; border: 1px solid #cbd5e1; }
.mandalart-block.is-center-block { border: 2px solid var(--tool-brand); background: #fff8f5; box-shadow: 0 2px 10px rgba(245,107,76,0.12); }
.mandalart-cell { min-width: 0; aspect-ratio: 1 / 1; min-height: 60px; display: flex; align-items: center; justify-content: center; padding: 4px; }
.mandalart-cell textarea { width: 100%; height: 100%; border: 1px solid #e2e8f0; border-radius: 6px; background: #fbfcfe; font: inherit; font-size: 0.74rem; text-align: center; resize: none; padding: 4px; line-height: 1.3; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.mandalart-cell textarea:focus { border-color: var(--tool-brand); outline: none; background: #ffffff; box-shadow: 0 0 0 2px rgba(245,107,76,0.2); }
.mandalart-cell.is-block-center textarea { background: #f1f5f9; font-weight: 700; border-color: #94a3b8; color: var(--tool-ink); }
.mandalart-cell.is-core-goal textarea { background: var(--tool-brand); color: #ffffff !important; font-weight: 800; font-size: 0.8rem; border-color: var(--tool-brand-dark); }
.mandalart-cell.is-core-goal textarea::placeholder { color: rgba(255,255,255,0.7); }

/* Dark Mode Overrides */
html[data-theme="dark"] .life-card { background: #1a1c20; border-color: #303236; }
html[data-theme="dark"] .life-stat-box { background: #202226; border-color: #303236; }
html[data-theme="dark"] .unit-result-card { background: #202226; border-color: #303236; }
html[data-theme="dark"] .unit-result-card:hover { border-color: var(--tool-brand); background: #26211f; }
html[data-theme="dark"] .unit-result-card.is-active { background: #2c1e18; border-color: var(--tool-brand); }
html[data-theme="dark"] .date-highlight-card { background: #202226; border-color: #303236; }
html[data-theme="dark"] .dday-badge.is-past { background: #2a2d33; color: #9ca3af; }
html[data-theme="dark"] .dday-badge.is-future { background: #1e3a5f; color: #7dd3fc; }
html[data-theme="dark"] .compound-chart-wrap { background: #1a1c20; border-color: #303236; }
html[data-theme="dark"] .meeting-agenda-item { background: #202226; border-color: #303236; }
html[data-theme="dark"] .meeting-agenda-item.is-current { background: #2c1e18; border-color: var(--tool-brand); }
html[data-theme="dark"] .meeting-agenda-item.is-done { background: #16181b; }
html[data-theme="dark"] .agenda-actions button { background: #2a2d33; border-color: #3e4249; color: #e5e7eb; }
html[data-theme="dark"] .check-progress-bar { background: #303236; }
html[data-theme="dark"] .memo-sidebar, html[data-theme="dark"] .memo-editor { background: #1a1c20; border-color: #303236; }
html[data-theme="dark"] .memo-list-item { background: #202226; border-color: #303236; }
html[data-theme="dark"] .memo-list-item:hover { background: #262930; }
html[data-theme="dark"] .memo-list-item.is-active { background: #2c1e18; border-color: var(--tool-brand); }
html[data-theme="dark"] .memo-search-input, html[data-theme="dark"] .memo-title-input, html[data-theme="dark"] .memo-body-textarea { background: #202226; border-color: #303236; color: #f1f5f9; }
html[data-theme="dark"] .month-card { background: #1a1c20; border-color: #303236; }
html[data-theme="dark"] .mindmap-viewport { background: #16181b; border-color: #303236; }
html[data-theme="dark"] .mandalart-board { background: #1a1c20; border-color: #303236; }
html[data-theme="dark"] .mandalart-block { background: #202226; border-color: #303236; }
html[data-theme="dark"] .mandalart-block.is-center-block { background: #241d1a; border-color: var(--tool-brand); }
html[data-theme="dark"] .mandalart-cell textarea { background: #282b31; border-color: #383c44; color: #f1f5f9; }
html[data-theme="dark"] .mandalart-cell textarea:focus { background: #202226; border-color: var(--tool-brand); }
html[data-theme="dark"] .mandalart-cell.is-block-center textarea { background: #343942; border-color: #4b525d; color: #ffffff; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .memo-container { grid-template-columns: 1fr; }
    .memo-sidebar { max-height: 220px; }
    .calendar-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
    .focus-timer-box, .meeting-timer-box { padding: 24px 14px; }
}

@media (max-width: 480px) {
    .unit-results-grid { grid-template-columns: 1fr 1fr; }
    .life-stat-grid { grid-template-columns: 1fr 1fr; }
    .calendar-grid { grid-template-columns: 1fr; }
    .mandalart-board { min-width: 620px; gap: 4px; padding: 4px; }
    .mandalart-block { gap: 2px; padding: 4px; }
    .mandalart-cell { min-height: 52px; }
}

/* Print Stylesheet for Calendar */
@media print {
    body { background: #ffffff !important; color: #000000 !important; }
    .tool-header, .tool-footer, .guide-card, .page-heading, .calendar-controls, .breadcrumbs, .status-message, .tool-shell-header { display: none !important; }
    .tool-main, .tool-container, .tool-layout, .tool-shell, .tool-shell-body { width: 100% !important; margin: 0 !important; padding: 0 !important; border: none !important; box-shadow: none !important; }
    .calendar-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 8px !important; }
    .month-card { border: 1px solid #999999 !important; page-break-inside: avoid; }
    .cal-table th, .cal-table td { padding: 2px 0 !important; }
    .cal-cell-inner { width: 18px !important; height: 18px !important; font-size: 0.7rem !important; }
}
