@charset "UTF-8";

/* =========================================
   共通ベーススタイル
   ========================================= */
body {
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    margin: 0;
    padding: 0;
    background: #e9ecef;
}

/* ヘッダーとフッターは即時表示させ、作業領域のみ構築完了するまで非表示（チラつき防止） */
body>*:not(#site-header):not(#site-footer) {
    opacity: 0;
}

body.is-ready>*:not(#site-header):not(#site-footer) {
    opacity: 1;
    transition: opacity 0.2s ease-out;
}


/* 図面作成画面 用のレイアウト */
body:not(:has(.menu-grid)) {
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
}

/* サイトヘッダー */
#site-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: #fff;
    border-bottom: 1px solid #e0e0e0;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    z-index: 50;
}


#site-header a {
    display: inline-flex;
    align-items: center;
    transition: opacity 0.2s;
}

#site-header a:hover {
    opacity: 0.7;
}

#site-header img {
    height: 30px;
    width: auto;
}

#site-header-cta {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s, transform 0.1s;
}

.cta-btn::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    border-top: 2px solid currentColor;
    border-right: 2px solid currentColor;
    transform: rotate(45deg);
    flex-shrink: 0;
}

.cta-btn:hover {
    opacity: 0.85;
    transform: translateY(-1px);
}

.cta-btn--glass {
    background: #0075bc;
    color: #fff;
}

.cta-btn--mirror {
    background: #00ab95;
    color: #fff;
}

/* ツールコンテナ（サイドバー＋リサイザー＋メインワークスペース） */
#tool-container {
    display: flex;
    flex-direction: row;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* サイトフッター（注意書き用） */
#site-footer {
    padding: 14px 20px;
    background: #f8f9fa;
    border-top: 1px solid #dee2e6;
    color: #6c757d;
    font-size: 11px;
    flex-shrink: 0;
    z-index: 50;
    text-align: left;
    line-height: 1.5;
}



/* =========================================
   図面作成画面 コンポーネント
   ========================================= */
.sidebar {
    width: 450px;
    min-width: 450px;
    max-width: 450px;
    background: white;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    overflow: hidden;
    z-index: 10;
}

.sidebar-scroll-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 15px 12px 12px;
    box-sizing: border-box;
}

.tool-title {
    margin: 0 0 10px 0;
    padding: 10px 12px;
    font-size: 18px;
    color: #2c3e50;
    background-color: #f1f5f9;
    border-left: 5px solid #3498db;
    border-bottom: 1px solid #dee2e6;
    font-weight: bold;
    border-radius: 2px;
}

.resizer {
    width: 6px;
    background-color: #f1f5f9;
    cursor: col-resize;
    z-index: 20;
    transition: background-color 0.2s ease;
    border-left: 1px solid #dee2e6;
    border-right: 1px solid #dee2e6;
}

.resizer:hover,
.resizer:active {
    background-color: #3498db;
}

#resizer-right {
    display: none !important;
}

.main-workspace {
    flex: 1;
    padding: 0;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
}

.canvas-container {
    flex: 1;
    width: 100%;
    min-height: 0;
    overflow: auto;
    padding: 30px;
    box-sizing: border-box;
}

canvas {
    display: block;
    margin: 0 auto;
    background: #fff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    max-width: calc(100% * var(--zoom-scale, 1));
    max-height: calc(100% * var(--zoom-scale, 1));
    width: auto;
    height: auto;
    transition: max-width 0.2s cubic-bezier(0.4, 0, 0.2, 1), max-height 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: grab;
}

.canvas-container.is-dragging,
.canvas-container.is-dragging canvas {
    cursor: grabbing !important;
    user-select: none;
}

/* 表示精度切替ボタン */
.precision-toggle {
    position: absolute;
    top: 20px;
    right: 30px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.precision-warning-box {
    position: relative;
    background: #fff5f5;
    border: 1px solid #ffcfcf;
    color: #e03131;
    padding: 12px 34px 12px 14px;
    border-radius: 8px;
    font-size: 11px;
    line-height: 1.5;
    max-width: 280px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    animation: fadeIn 0.3s ease-out;
}

.warning-close-btn {
    position: absolute;
    top: 6px;
    right: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s;
}

.warning-close-btn:hover {
    background: rgba(224, 49, 49, 0.1);
}

.warning-close-btn img {
    width: 14px;
    height: 14px;
    /* #e03131 に変換するフィルタ */
    filter: invert(21%) sepia(96%) saturate(3045%) hue-rotate(349deg) brightness(85%) contrast(92%);
    opacity: 0.8;
}

.precision-warning-mini {
    background: #fff5f5;
    border: 1px solid #ffcfcf;
    padding: 6px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.2s;
    animation: fadeIn 0.3s ease-out;
}

.precision-warning-mini:hover {
    background: #ffffff;
    border-color: #e03131;
    transform: scale(1.1);
}

.precision-warning-mini img {
    width: 20px;
    height: 20px;
    /* #e03131 に変換するフィルタ */
    filter: invert(21%) sepia(96%) saturate(3045%) hue-rotate(349deg) brightness(85%) contrast(92%);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.precision-btn {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid #dcdfe6;
    color: #606266;
    padding: 8px 20px;
    border-radius: 20px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    outline: none;
    white-space: nowrap;
    user-select: none;
}

.precision-btn:hover {
    background: #ffffff;
    border-color: #3498db;
    color: #3498db;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.15);
    transform: translateY(-1.5px);
}

.precision-btn:active {
    transform: translateY(0.5px);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.canvas-zoom-controls {
    position: absolute;
    bottom: 25px;
    right: 30px;
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    color: #2c3e50;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.zoom-btn:hover {
    background: #f8f9fa;
    border-color: #3498db;
    color: #3498db;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.zoom-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.zoom-btn img {
    width: 20px;
    height: 20px;
}

.zoom-btn.reset {
    font-size: 11px;
    font-weight: 700;
}



/* セクションヘッダーバー（青帯） */
.section-bar {
    background: #0075bc;
    color: #fff;
    font-size: 16px;
    font-weight: bold;
    padding: 14px 16px;
    margin: 0 -12px;
    border-bottom: 4px solid #00488c;
}

#common-header {
    display: contents;
}

#common-header .section-bar {
    margin: -15px -12px 0;
}

/* 単位の吹き出し */
.unit-bubble {
    background: #fff;
    color: #231815;
    font-size: 13px;
    font-weight: bold;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #231815;
    margin: 0 -2px 8px;
    position: relative;
}

.unit-bubble::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 24px;
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-top: 10px solid #231815;
}

.unit-bubble::before {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 26px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 8px solid #fff;
    z-index: 1;
}

.unit-bubble .unit-highlight {
    color: #c11c20;
    font-weight: bold;
}

/* UI セクション & フォーム */
.ui-section {
    background: #f6f6f6;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ui-section-title {
    font-size: 14px;
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 12px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 6px;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.help-link {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

.help-link:hover {
    opacity: 0.6;
}

.help-link img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
}

.section-body-toggle {
    display: none;
    padding-top: 5px;
    border-top: 2px solid #e0e0e0;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.section-header .ui-section-title {
    margin: 0;
    border: none;
    padding: 0;
}

.section-label {
    font-size: 12px;
    font-weight: bold;
    color: #444;
    margin-bottom: 5px;
    display: block;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
    background: #fff;
    padding: 6px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    flex: 1;
}

.input-wrapper {
    display: flex;
    align-items: center;
    gap: 5px;
    width: 100%;
    position: relative;
}

label {
    font-size: 12px;
    font-weight: bold;
    color: #444;
}

.input-icon {
    width: 32px;
    height: 32px;
    color: #888;
    flex-shrink: 0;
    margin-right: 4px;
    transition: transform 0.2s ease-in-out;
}

.ui-section.is-flipped .input-icon {
    transform: scaleX(-1);
}

.unit-text {
    font-size: 11px;
    color: #666;
    white-space: nowrap;
    flex-shrink: 0;
}

.back-link {
    text-decoration: none;
    color: #3498db;
    font-size: 14px;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: color 0.2s;
}

.back-link:hover {
    color: #0075bc;
}

.back-link::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-color: currentColor;
    -webkit-mask: url('../images/icons/home.svg') no-repeat center;
    mask: url('../images/icons/home.svg') no-repeat center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

input,
select,
textarea {
    padding: 6px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
    box-sizing: border-box;
}

input:read-only,
select:disabled,
textarea:read-only {
    background-color: #e9ecef;
    border-color: #dee2e6;
    color: #495057;
    cursor: not-allowed;
}

.lock-btn {
    padding: 5px 12px 5px 32px;
    font-size: 11px;
    background: #3498db url('../images/icons/lock.svg') no-repeat 8px center;
    background-size: 16px 16px;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
    user-select: none;
    line-height: 1.4;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    white-space: nowrap;
    min-height: 28px;
    justify-content: center;
}

.lock-btn.unlocked {
    background: #7f8c8d url('../images/icons/unlock.svg') no-repeat 8px center;
    background-size: 16px 16px;
}

input[type="number"],
.math-input {
    width: 80px;
    padding: 10px 8px;
    font-size: 16px;
    text-align: right;
}

/* 追加: インライン配置などで枠線を消したい場合用 */
.input-group.plain {
    border: none;
    background: transparent;
    padding: 0;
}

.w-full {
    width: 100% !important;
}

.w-140 {
    width: 140px !important;
}

.flex-1 {
    flex: 1;
}

.mt-5 {
    margin-top: 5px !important;
}

.mt-10 {
    margin-top: 10px !important;
}

.mb-0 {
    margin-bottom: 0 !important;
}

.mb-12 {
    margin-bottom: 12px !important;
}

.hidden {
    display: none !important;
}

select,
textarea {
    width: 100%;
}

textarea {
    resize: vertical;
}

/* ボタン */
.btn-area {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

button {
    padding: 5px 12px;
    cursor: pointer;
    border: none;
    border-radius: 4px;
    font-weight: bold;
    font-family: inherit;
    font-size: 12px;
    transition: 0.2s;
}

button:hover {
    opacity: 0.9;
}

.btn-update {
    background: #2c3e50;
    color: white;
    padding: 12px;
    font-size: 14px;
    flex: 1;
    display: none;
}

.btn-pdf {
    background: #00ab95;
    color: white;
    padding: 16px 12px;
    margin: 4px 16px;
    font-size: 16px;
    font-weight: bold;
    flex: 1;
    border-radius: 6px;
    box-shadow: -4px 4px 0 rgba(0, 42, 34, 0.75);
    transition: all 0.2s;
}

.btn-pdf:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.btn-pdf:active {
    transform: translate(-2px, 2px);
    box-shadow: -2px 2px 0 rgba(0, 42, 34, 0.75);
}

.btn-del {
    background: #e74c3c;
    color: white;
    padding: 4px 8px;
    margin: 0;
}

/* 動的追加行 (カット・穴あけ等) */
.dynamic-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fff;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 8px;
}

.dynamic-row-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dynamic-row-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.footer-options {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-left: auto;
}

.footer-options .option-item {
    margin-bottom: 0;
}

.dynamic-row-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 10px;
    align-items: center;
}

.dynamic-row-inputs label {
    width: 32px;
    display: inline-block;
    flex-shrink: 0;
}

/* =========================================
   トグルスイッチ (モダンなON/OFFデザイン)
   ========================================= */
.option-item {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #444;
    user-select: none;
}

.option-item:last-child {
    margin-bottom: 0;
}

#display-options {
    border-top: 1px solid #dee2e6;
    padding-top: 10px;
    margin-top: 4px;
}

.option-item input {
    display: none;
}

/* スイッチのベース（枠とレール） */
.icon-toggle {
    width: 56px;
    height: 24px;
    background-color: #e9ecef;
    border-radius: 20px;
    position: relative;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #dee2e6;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* 内部テキスト共通設定 */
.icon-toggle::before {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    font-weight: bold;
    transition: all 0.3s ease;
}

/* 【OFF状態】の設定 */
input:not(:checked)+.icon-toggle::before {
    content: 'OFF';
    right: 10px;
    color: #000000;
}

/* 【ON状態】の設定 */
input:checked+.icon-toggle::before {
    content: 'ON';
    left: 12px;
    color: #ffffff;
}

/* スイッチの中の丸いボタン */
.icon-toggle::after {
    content: '';
    width: 18px;
    height: 18px;
    background-color: #fff;
    border-radius: 50%;
    position: absolute;
    top: 2px;
    left: 2px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.option-item:hover .icon-toggle {
    background-color: #0a5a8a;
}

/* ON時のレール */
input:checked+.icon-toggle {
    background-color: #0f6fac;
    border-color: #0a5a8a;
}

/* ON時の丸いボタン（右へ移動） */
input:checked+.icon-toggle::after {
    left: calc(100% - 20px);
}

/* ON時のテキストの強調 */
input:checked~span {
    color: #2c3e50;
    font-weight: bold;
}

#common-remarks {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#common-header {
    flex-shrink: 0;
    background: #fff;
    padding: 15px 12px 12px;
    border-bottom: 1px solid #e0e0e0;
}

#common-footer {
    flex-shrink: 0;
    background: #fff;
    padding: 12px 12px 15px;
    border-top: 1px solid #e0e0e0;
}

/* サイズ入力欄（幅W・高さH）の大きめ表示 */
.size-inputs input[type="number"] {
    font-size: 24px;
    padding: 12px 10px;
    font-weight: bold;
}

.size-inputs .unit-text {
    font-size: 18px;
    font-weight: bold;
    color: #231815;
}

.size-inputs label {
    font-size: 14px;
}

.footer-filename {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.footer-filename-label {
    font-size: 12px;
    font-weight: bold;
    color: #444;
    white-space: nowrap;
    flex-shrink: 0;
}

.footer-filename input {
    flex: 1;
    min-width: 0;
}

/* =========================================
   四角形 (Rectangle) 専用コンポーネント
   ========================================= */
.flex-row {
    display: flex;
    gap: 10px;
    margin-bottom: 12px;
}

.flex-row:last-child {
    margin-bottom: 0;
}

.input-group-inline {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}

.input-group-inline:last-child {
    margin-bottom: 0;
}

.toggleable {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 10px;
    margin: -5px -5px 10px -5px;
    border-radius: 4px;
    border-bottom: none;
    transition: background 0.2s;
}

.toggleable:hover {
    background: #e2e6ea;
}

.toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    transition: transform 0.2s;
}

.toggle-icon img {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
    opacity: 0.6;
}

.corner-grid-wrapper {
    display: grid;
    grid-template-columns: 1fr 80px 1fr;
    gap: 10px;
    align-items: center;
}

.corner-label {
    font-size: 12px;
    color: #0075bc;
    font-weight: bold;
    margin-bottom: 5px;
}

.center-box-icon {
    width: 36px;
    height: 26px;
    border: 2px solid #aaa;
    position: relative;
    margin: auto;
    background: #fff;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
}

.corner-link-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    transition: all 0.2s;
    border-radius: 4px;
}

.corner-link-btn:hover {
    background: rgba(0, 117, 188, 0.1);
}

.corner-link-btn img {
    width: 18px;
    height: 18px;
    opacity: 0.4;
    transition: all 0.2s;
}

.corner-link-btn.is-linked img {
    opacity: 1;
    filter: none;
}

.c-dot {
    width: 6px;
    height: 6px;
    background: #0075bc;
    position: absolute;
    border-radius: 50%;
    box-shadow: 0 0 0 2px #fff;
}

.c-tl {
    top: -3px;
    left: -3px;
}

.c-tr {
    top: -3px;
    right: -3px;
}

.c-bl {
    bottom: -3px;
    left: -3px;
}

.c-br {
    bottom: -3px;
    right: -3px;
}

/* 追加: 角加工の入力行用 */
.corner-input-row {
    display: none;
    align-items: center;
    gap: 4px;
}

.corner-input-label {
    font-size: 11px;
    font-weight: bold;
    width: 26px;
    flex-shrink: 0;
}

.align-start {
    align-items: flex-start;
}

.align-end {
    align-items: flex-end;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.gap-4 {
    gap: 4px;
}

.grid-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
}

.justify-end {
    justify-items: end;
}

.btn-orange {
    background: #db7200;
    color: white;
    padding: 8px 14px;
    border-radius: 5px;
    box-shadow: 2px 2px 0 rgba(65, 43, 18, 0.75);
}

.btn-copy {
    background: #7f8c8d;
    color: white;
}

/* =========================================
   モバイルタブバー
   ========================================= */
#mobile-tab-bar {
    display: none;
    flex-shrink: 0;
    background: #fff;
    border-bottom: 2px solid #e0e0e0;
    z-index: 40;
}

.mobile-tab {
    flex: 1;
    padding: 11px 8px;
    font-size: 13px;
    font-weight: bold;
    color: #888;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.mobile-tab.is-active {
    color: #3498db;
    border-bottom-color: #3498db;
}

/* =========================================
   レスポンシブ & 印刷対応
   ========================================= */
@media (max-width: 767px) {
    #site-header {
        padding: 12px 16px;
        gap: 10px 16px;
        flex-wrap: wrap;
    }

    #site-header img {
        height: 22px;
    }

    #site-header-cta {
        width: 100%;
        gap: 6px;
        margin-left: 0;
    }

    .cta-btn {
        flex: 1;
        justify-content: center;
        font-size: 11px;
        padding: 7px 8px;
    }

    #mobile-tab-bar {
        display: flex;
    }

    body:not(:has(.menu-grid)) {
        height: 100vh;
        height: 100dvh;
        flex-direction: column;
        overflow: hidden;
    }

    body {
        overflow-x: hidden;
    }

    #tool-container {
        flex-direction: column;
        width: 100%;
        overflow-x: hidden;
    }

    .sidebar {
        width: 100% !important;
        min-width: 0 !important;
        max-width: 100% !important;
        flex: 1;
        min-height: 0;
        box-shadow: none;
    }

    .sidebar-scroll-area {
        overflow-x: hidden;
    }

    .main-col {
        flex: 1;
        min-height: 0;
        min-width: 0;
        overflow-x: hidden;
    }

    .resizer {
        display: none;
    }

    .canvas-container {
        padding: 16px;
    }

    #site-footer {
        font-size: 10px;
        padding: 8px 12px;
        line-height: 1.4;
    }

    .sidebar.mobile-hidden,
    .main-col.mobile-hidden {
        display: none !important;
    }

    .canvas-zoom-controls,
    .calculator-widget {
        display: none !important;
    }

    .precision-toggle {
        top: 8px;
        right: 8px;
    }

    .canvas-container {
        padding-top: 52px;
    }
}

@media (max-width: 600px) {
    .info-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .release-notes li {
        flex-wrap: wrap;
        gap: 8px;
    }

    .release-desc {
        width: 100%;
        padding-left: 5px;
    }
}

/* =========================================
   ガラスドアツール特有のスタイル
   ========================================= */
.spec-info {
    font-size: 11px;
    color: #666;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #eee;
    margin-top: -6px;
    margin-bottom: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.lock-toggle {
    background: none;
    border: none;
    padding: 2px 5px;
    margin: 0;
    font-size: 14px;
    opacity: 0.6;
    transition: 0.2s;
    user-select: none;
}

.lock-toggle:hover {
    opacity: 1;
    transform: scale(1.1);
}

.lock-toggle.unlocked {
    opacity: 1;
}

/* 吊元側などのボタンがないフィールド用 */
.range-guide {
    font-size: 10px;
    color: #868e96;
    margin-top: 2px;
    padding-left: 2px;
}

.warning-info {
    font-size: 11px;
    font-weight: bold;
    color: #e74c3c;
    background: #fdf2f2;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #fabebb;
    margin-top: -6px;
    margin-bottom: 12px;
    line-height: 1.4;
    white-space: pre-wrap;
}

.warning-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
    margin-top: -2px;
    filter: invert(75%) sepia(85%) saturate(1500%) hue-rotate(3deg) brightness(105%) contrast(105%);
}

.calc-footer {
    background: #2c3e50;
    margin-top: 20px;
    padding: 15px;
    color: white;
    z-index: 100;
    transition: padding 0.4s ease-in-out;
}

/* 右側サイドバーとしてのスタイル */
.right-sidebar {
    width: 400px;
    min-width: 400px;
    max-width: 400px;
    background: #2c3e50;
    color: white;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    padding: 0;
    /* calc-footer側でパディングを持つため */
    box-sizing: border-box;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 10;
    position: relative;
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1), min-width 0.3s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 最小化（右に畳まれた状態） */
.right-sidebar.collapsed {
    width: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    overflow: hidden;
}

.right-sidebar.collapsed .calc-footer {
    padding: 0;
}

.right-sidebar.collapsed .calc-title {
    writing-mode: vertical-rl;
    text-orientation: mixed;
    border-bottom: none;
    height: 100%;
    margin: 0;
    padding: 0;
    font-size: 0;
}

/* サイドバー内のcalc-footer調整 */
.right-sidebar .calc-footer {
    position: static;
    margin: 0;
    box-shadow: none;
    background: transparent;
    height: 100%;
}

.calc-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.calc-section {
    margin-bottom: 25px;
}

.calc-section:last-child {
    margin-bottom: 0;
}

.calc-section-title {
    font-size: 13px;
    font-weight: bold;
    color: #3498db;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.calc-section-title::after {
    content: "";
    flex: 1;
    height: 1px;
    background: #455a64;
}

.calc-info-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-left: 10px;
}

.calc-info-item {
    display: flex;
    font-size: 13px;
    gap: 12px;
}

.calc-info-label {
    color: #bdc3c7;
    width: 65px;
    flex-shrink: 0;
}

.calc-info-value {
    color: #ffffff;
    font-weight: bold;
}

/* ガラス見出し (例: "ドアガラス:", "袖ガラス(左):") */
.calc-label {
    font-weight: bold;
    font-size: 14px;
    color: #bdc3c7;
    margin-bottom: 4px;
}

.calc-values {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 12px;
}

/* ガラスサイズ表示 (例: "900 × 2100 ミリ") */
.size-val {
    font-weight: bold;
    font-size: 15px;
    margin-right: 8px;
}

/* 厚み表示 (例: "厚み8ミリ") */
.thick-val {
    font-size: 13px;
    color: #ffffff;
    margin-right: 8px;
}

/* 重さ表示 (例: "12.5 kg") */
.weight-val {
    font-size: 13px;
    color: #ffffff;
}

/* クリアランス情報*/
.clearance-info {
    font-size: 11px;
    color: #cccccc;
    margin-top: 4px;
}

/* 自動算出寸法・重量のタイトル */
.calc-title {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 8px;
    padding: 0 10px 0 55px;
    /* 左側にボタンのスペースを確保 */
    border-bottom: 1px solid #455a64;
    display: flex;
    align-items: center;
    min-height: 50px;
    /* ボタン(40px)＋上下マージン5pxずつ */
    transition: margin 0.4s ease-in-out, padding 0.4s ease-in-out, border-color 0.4s ease-in-out;
}

.min-btn {
    position: absolute;
    top: 5px;
    /* (50px - 40px) / 2 = 5px で中央揃え */
    left: 8px;
    background: transparent url('../images/icons/arrow-2_up.svg') no-repeat center;
    background-size: 32px 32px;
    filter: invert(1);
    width: 40px;
    height: 40px;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s;
    transform: rotate(90deg) scale(1.0);
    z-index: 101;
}

.min-btn:hover {
    transform: rotate(90deg) scale(1.2);
    opacity: 1;
}

.right-sidebar.collapsed .min-btn {
    transform: rotate(-90deg) scale(1.0);
    /* 畳み込み時は右向き */
    left: 5px;
}

.right-sidebar.collapsed .min-btn:hover {
    transform: rotate(-90deg) scale(1.2);
}

.calc-content-wrapper {
    overflow: hidden;
    max-height: 2000px;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    opacity: 1;
    transform: translateX(0);
}

.right-sidebar.collapsed .calc-content-wrapper {
    opacity: 0;
    pointer-events: none;
    transform: translateX(20px);
    /* 畳み込み時は右にずらす */
}

@media print {
    body {
        background: white;
        display: block;
        height: auto;
    }

    .sidebar {
        display: none !important;
    }

    .resizer {
        display: none !important;
    }

    .main-workspace {
        padding: 0;
        display: block;
        overflow: visible;
    }

    .canvas-container {
        border: none;
        max-width: none !important;
        width: auto;
        margin: 0;
    }

    canvas {
        width: 100%;
        height: auto;
        max-width: none;
        max-height: none;
        box-shadow: none;
    }

    .calculator-widget {
        display: none !important;
    }
}

/* =========================================
   簡易電卓ウィジェット
   ========================================= */
.calculator-widget {
    position: absolute;
    bottom: 25px;
    left: 30px;
    z-index: 100;
    width: 280px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.calculator-widget.minimized {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

.calculator-widget.minimized .calculator-body {
    display: none;
}

.calculator-header {
    background: #2c3e50;
    color: #fff;
    padding: 10px 15px;
    font-size: 13px;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: all 0.3s;
}

.calculator-widget.minimized .calculator-header {
    padding: 0;
    justify-content: center;
    height: 100%;
    border-radius: 50%;
}

.calc-icon {
    width: 20px;
    height: 20px;
    filter: invert(1);
    transition: all 0.3s;
}

.calculator-widget.minimized .calc-icon {
    width: 24px;
    height: 24px;
}

.calculator-header .toggle-icon {
    font-size: 10px;
    color: #fff;
    transition: transform 0.3s;
}

.calculator-widget.minimized .calculator-header .toggle-icon {
    display: none;
}

.calculator-body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.calculator-history {
    width: 100%;
    height: 60px;
    padding: 6px;
    font-size: 11px;
    text-align: right;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background: #e9ecef;
    color: #495057;
    overflow-y: auto;
    resize: none;
    margin-bottom: 2px;
}

.calculator-display {
    width: 100%;
    padding: 8px;
    font-size: 16px;
    text-align: right;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
    background: #f8f9fa;
    color: #333;
}

.calculator-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 5px;
}

.calc-btn {
    padding: 8px 0;
    font-size: 14px;
    background: #f1f3f5;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    color: #495057;
    transition: all 0.1s;
}

.calc-btn:hover {
    background: #e9ecef;
}

.calc-btn:active {
    background: #dee2e6;
    transform: scale(0.95);
}

.calc-btn.op {
    background: #e7f5ff;
    color: #1971c2;
    border-color: #d0ebff;
}

.calc-btn.op:hover {
    background: #d0ebff;
}

.calc-btn.eq {
    background: #3498db;
    color: #fff;
    border-color: #2980b9;
}

.calc-btn.eq:hover {
    background: #2980b9;
}

.calc-btn.cl {
    background: #ffeee8;
    color: #e03131;
    border-color: #ffd8a8;
}

.calc-btn.cl:hover {
    background: #ffc9c9;
}

.calc-btn.zero {
    grid-column: span 2;
}