.apps-menu { position: relative; }
.apps-menu summary { cursor: pointer; list-style: none; }
.apps-menu summary::-webkit-details-marker { display: none; }
.apps-menu[open] { z-index: 5; }
.apps-menu-list {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 220px;
    padding: 6px;
    background: #fff;
    border: 1px solid #dfe4ef;
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(32, 45, 80, 0.18);
    text-align: left;
}
.apps-menu-list a {
    display: block;
    padding: 8px 10px;
    color: var(--text-secondary);
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.85rem;
}
.apps-menu-list a:hover, .apps-menu-list a:focus-visible { background: #eef3ff; color: var(--accent-blue); }
.apps-menu-list a[aria-current="page"] { background: #eef3ff; color: var(--accent-blue); font-weight: 600; }
.apps-menu-list a i { margin-left: 4px; font-size: 0.7rem; color: var(--text-muted); }
.apps-menu-list hr { margin: 6px 4px; border: 0; border-top: 1px solid #e4e9f1; }
.tools-container { max-width: 1100px; }
.tools-stack { display: grid; gap: 20px; }
.tools-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.tool-card { min-width: 0; padding: 22px; scroll-margin-top: 20px; }
.tool-card:hover { transform: none; }
.tool-card .card-header { margin-bottom: 18px; }
.tool-card .card-header h2 { font-size: 1rem; font-weight: 600; color: var(--text-primary); }
.lookup-input-row { display: flex; gap: 10px; align-items: stretch; }
.lookup-input-row input { min-width: 0; flex: 1; min-height: 44px; }
.lookup-input-row button { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border: 0; border-radius: 8px; font: 600 0.85rem var(--font-sans); cursor: pointer; }
.lookup-input-row button:disabled { opacity: 0.7; cursor: wait; }
.lookup-status { color: var(--accent-orange); font-size: 0.85rem; }
.lookup-status:not(:empty) { margin-top: 10px; }
.lookup-result { margin-top: 20px; border-top: 1px solid #dce4ef; padding-top: 16px; }
.lookup-result-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.lookup-result-heading h3, .time-result-heading h3 { font-size: 0.95rem; font-weight: 600; color: var(--text-primary); }
.lookup-result-heading span { font-size: 0.75rem; color: var(--text-muted); }
.lookup-details { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-top: 8px; }
.lookup-details div { display: grid; grid-template-columns: minmax(100px, 0.8fr) minmax(0, 1.2fr); gap: 8px; padding: 8px 0; border-bottom: 1px solid #e4e9f1; font-size: 0.84rem; }
.lookup-details dt { color: var(--text-muted); }
.lookup-details dd { color: var(--text-primary); overflow-wrap: anywhere; font-weight: 500; }
.lookup-map { display: inline-block; margin-top: 14px; color: var(--accent-blue); font-size: 0.83rem; font-weight: 600; }
.lookup-map[hidden] { display: none; }
.tool-card label { display: block; margin-bottom: 6px; color: var(--text-secondary); font-size: 0.83rem; font-weight: 600; }
.tool-card input, .tool-card textarea {
    display: block;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.85);
    color: var(--text-primary);
    font: 0.85rem/1.5 var(--font-mono);
}
.tool-card textarea { min-height: 100px; resize: vertical; }
.tool-card input:focus, .tool-card textarea:focus { outline: 2px solid rgba(37, 99, 235, 0.35); border-color: var(--accent-blue); }
.tool-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.tool-actions button { min-height: 36px; padding: 7px 14px; border: 1px solid transparent; border-radius: 8px; font: 600 0.83rem var(--font-sans); cursor: pointer; }
.tool-primary { background: var(--accent-blue); color: white; }
.tool-secondary, .tool-copy { background: white; border-color: #cbd5e1 !important; color: var(--text-secondary); }
.tool-actions button:hover { filter: brightness(0.95); }
.tool-actions a { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 7px 14px; border: 1px solid transparent; border-radius: 8px; font: 600 0.83rem var(--font-sans); text-decoration: none; }
.tool-actions a:hover { filter: brightness(0.95); }
.not-found { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 36px; max-width: 760px; margin: 0 auto; padding: 36px 40px; }
.not-found-art { width: 100%; height: auto; }
.not-found h2 { margin: 6px 0 10px; font-size: 1.6rem; line-height: 1.25; color: var(--text-primary); }
.not-found p { margin: 0; color: var(--text-secondary); line-height: 1.6; }
.not-found code { padding: 1px 6px; border-radius: 6px; background: #eef2f8; font-family: var(--font-mono); font-size: 0.85em; word-break: break-all; }
.not-found .not-found-code { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent-blue); }
.not-found .tool-actions { margin-top: 22px; }
@media (max-width: 640px) {
    .not-found { grid-template-columns: 1fr; gap: 16px; padding: 28px 20px; text-align: center; }
    .not-found-art { max-width: 160px; margin: 0 auto; }
    .not-found .tool-actions { justify-content: center; }
}
.tool-copy { width: 36px; padding: 0 !important; }
.tool-note { color: var(--accent-orange); font-size: 0.75rem; }
.tool-output {
    min-height: 64px;
    margin-top: 14px;
    padding: 12px;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
    border: 1px solid #dce4ef;
    border-radius: 8px;
    background: rgba(245, 248, 253, 0.9);
    color: var(--text-secondary);
    font: 0.78rem/1.6 var(--font-mono);
}
.form-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px 14px; }
.form-grid > div { min-width: 0; }
.form-grid input:not([type="checkbox"]), .form-grid select { min-height: 44px; }
.cron-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 12px; }
.tool-card label.check { display: inline-flex; align-items: center; gap: 6px; margin: 0; cursor: pointer; }
.tool-card label.check input { width: 16px; height: 16px; min-height: 0; margin: 0; padding: 0; accent-color: var(--accent-blue); cursor: pointer; }
.tool-card [hidden] { display: none !important; }
.card-reset { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 1px solid #cbd5e1; border-radius: 8px; background: white; color: var(--text-secondary); font: 600 0.8rem var(--font-sans); cursor: pointer; }
.card-reset:hover { color: var(--accent-blue); border-color: var(--accent-blue); }
.label-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0 8px; }
.label-row label.check { margin-bottom: 6px; color: var(--text-muted); font-size: 0.75rem; font-weight: 500; }
.tool-card input:disabled { background: #eef2f7; color: var(--text-muted); cursor: not-allowed; }
.command-box { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 10px 10px 10px 14px; border: 1px solid #dce4ef; border-radius: 8px; background: rgba(245, 248, 253, 0.9); }
.command-box code { flex: 1; min-width: 0; color: var(--text-primary); font: 500 0.85rem/1.6 var(--font-mono); overflow-wrap: anywhere; }
.command-box code::before { content: "$ "; color: var(--text-muted); }
.command-box.error { background: #fff7ed; border: 1px solid #fed7aa; }
.command-box.error code { color: #c2410c; font-family: var(--font-sans); }
.command-box.error code::before { content: none; }
.command-box.error .tool-copy { display: none; }
.command-box .tool-copy { flex: none; width: 36px; height: 36px; border: 1px solid #cbd5e1 !important; border-radius: 8px; background: white; color: var(--text-secondary); cursor: pointer; }
.command-box .tool-copy:hover { color: var(--accent-blue); border-color: var(--accent-blue) !important; }
.command-explain { margin-top: 10px; color: var(--text-secondary); font-size: 0.85rem; }
.command-warning { margin-top: 6px; color: #c2410c; font-size: 0.8rem; }
.command-warning:empty { display: none; }
.tools-footer { padding: 30px 0 0; color: var(--text-muted); font-size: 0.8rem; text-align: center; }
.tools-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.form-grid.pair-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.command-box.plain code::before { content: none; }
.chmod-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 0.84rem; }
.chmod-table th, .chmod-table td { padding: 8px; border-bottom: 1px solid #e4e9f1; text-align: center; }
.chmod-table th { color: var(--text-secondary); font-weight: 600; }
.chmod-table tbody th { text-align: left; }
.chmod-table input { display: inline-block; width: 16px; height: 16px; padding: 0; accent-color: var(--accent-blue); cursor: pointer; }
.status-pill { padding: 2px 10px; border-radius: 999px; font-size: 0.75rem; font-weight: 600; }
.status-pill.ok { background: #dcfce7; color: #166534; }
.status-pill.warn { background: #ffedd5; color: #c2410c; }
.status-pill.bad { background: #fee2e2; color: #b91c1c; }
.tool-output.ok { border-color: #bbf7d0; background: #f0fdf4; color: #166534; }
.tool-output.bad { border-color: #fed7aa; background: #fff7ed; color: #c2410c; }
.timezone-picker { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); align-items: end; gap: 10px; }
.timezone-picker > div, .time-inputs > div { min-width: 0; }
.tool-card select {
    width: 100%; min-width: 0; min-height: 44px; padding: 9px 10px; border: 1px solid #cbd5e1;
    border-radius: 8px; background: rgba(255, 255, 255, 0.85); color: var(--text-primary); font: 0.85rem var(--font-sans);
}
.tool-card select:focus { outline: 2px solid rgba(37, 99, 235, 0.35); border-color: var(--accent-blue); }
.time-swap { width: 40px; height: 44px; border: 1px solid #cbd5e1; border-radius: 8px; color: var(--accent-blue); background: white; cursor: pointer; }
.day-bar { display: flex; align-items: center; gap: 6px; margin-top: 16px; }
.day-list { display: flex; flex: 1; gap: 6px; min-width: 0; overflow-x: auto; }
.day-tab, .day-nav { border: 1px solid #dce4ef; border-radius: 8px; background: white; color: var(--text-secondary); cursor: pointer; }
.day-tab { display: flex; flex: 1 0 52px; flex-direction: column; align-items: center; padding: 5px 0; font-family: var(--font-sans); line-height: 1.2; }
.day-tab small { font-size: 0.65rem; text-transform: uppercase; }
.day-tab strong { font-size: 1rem; color: var(--text-primary); }
.day-tab[aria-pressed="true"] { background: var(--accent-blue); border-color: var(--accent-blue); color: white; }
.day-tab[aria-pressed="true"] strong { color: white; }
.day-nav { flex: none; width: 34px; height: 56px; color: var(--accent-blue); }
.tool-card input.day-picker { flex: none; width: 150px; min-height: 56px; font-family: var(--font-sans); }
.time-result { margin-top: 16px; }
.strip { display: grid; grid-template-columns: 200px minmax(0, 1fr); border: 1px solid #dce4ef; border-radius: 10px; background: rgba(255, 255, 255, 0.85); overflow: hidden; }
.strip-labels { border-right: 1px solid #e4e9f1; }
.strip-label { display: flex; flex-direction: column; justify-content: center; height: 84px; padding: 8px 14px; min-width: 0; }
.strip-label + .strip-label, .strip-row + .strip-row { border-top: 1px solid #e4e9f1; }
.strip-label span { overflow: hidden; color: var(--text-muted); font-size: 0.72rem; white-space: nowrap; text-overflow: ellipsis; }
.strip-label strong { color: var(--text-primary); font: 600 1rem var(--font-mono); }
.strip-label small { color: var(--text-secondary); font-size: 0.72rem; }
.strip-scroll { position: relative; overflow-x: auto; scroll-behavior: smooth; }
.strip-row { display: flex; align-items: flex-end; gap: 3px; width: max-content; height: 84px; padding: 0 10px 10px; }
.strip-cell {
    position: relative; display: flex; flex: none; flex-direction: column; align-items: center; justify-content: center;
    width: 42px; height: 50px; border: 0; border-radius: 6px; background: #eef2f7; color: var(--text-primary);
    font-family: var(--font-sans); line-height: 1.1; cursor: pointer;
}
.strip-cell strong { font-size: 0.95rem; font-weight: 600; }
.strip-cell sup { font-size: 0.55rem; }
.strip-cell small { color: var(--text-muted); font-size: 0.62rem; }
.strip-cell.work { background: #dcfce7; color: #166534; }
.strip-cell.night { background: #dde3ec; color: #475569; }
.strip-cell.new-day:not(:first-child)::before { content: ""; position: absolute; top: -18px; bottom: -4px; left: -3px; border-left: 2px solid #94a3b8; }
.strip-day { position: absolute; top: -18px; left: 0; color: var(--text-secondary); font-size: 0.62rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.strip-cell:hover { box-shadow: inset 0 0 0 1px #94a3b8; }
.strip-cell.selected { background: var(--accent-blue); color: white; box-shadow: 0 0 0 2px #1e3a8a; }
.strip-cell.selected small { color: rgba(255, 255, 255, 0.85); }
.strip-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; color: var(--text-secondary); font-size: 0.75rem; }
.legend-box { display: inline-block; width: 12px; height: 12px; margin-right: 4px; border-radius: 3px; background: #eef2f7; vertical-align: -1px; }
.legend-box.work { background: #dcfce7; }
.legend-box.night { background: #dde3ec; }
.strip-tip { margin-left: auto; color: var(--text-muted); }
@media (max-width: 900px) {
    .tools-pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 680px) {
    .tools-grid { grid-template-columns: minmax(0, 1fr); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .cron-grid { grid-template-columns: minmax(0, 1fr); }
    .tool-card { padding: 18px; }
    .lookup-input-row { flex-direction: column; }
    .lookup-details { grid-template-columns: minmax(0, 1fr); }
    .timezone-picker { grid-template-columns: minmax(0, 1fr) 40px; }
    .timezone-picker > div:last-child { grid-column: 1 / -1; }
    .day-bar { flex-wrap: wrap; }
    .day-list { flex-basis: calc(100% - 80px); }
    .day-tab { flex: 1 0 36px; }
    .day-tab:nth-child(1), .day-tab:nth-child(7) { display: none; }
    .tool-card input.day-picker { flex: 1 0 100%; width: 100%; min-height: 44px; }
    .strip { grid-template-columns: 118px minmax(0, 1fr); }
    .strip-label { padding: 8px 10px; }
    .strip-label strong { font-size: 0.82rem; }
    .strip-tip { margin-left: 0; }
}
@media (max-width: 360px) {
    .day-tab:nth-child(2), .day-tab:nth-child(6) { display: none; }
    .strip { grid-template-columns: 100px minmax(0, 1fr); }
}