:root{--gsheet-green: #0f9d58;--gsheet-green-dark: #0b8043;--gsheet-bg: #ffffff;--gsheet-grid: #dadce0;--gsheet-text: #202124;--gsheet-text-muted: #5f6368;--gsheet-highlight: #e6f4ea;--gsheet-yellow: #fef7e0}*{box-sizing:border-box}body{margin:0;font-family:-apple-system,Segoe UI,Roboto,Hiragino Sans,Noto Sans JP,sans-serif;color:var(--gsheet-text);background:var(--gsheet-bg)}.app-root{height:100vh;display:flex;flex-direction:column;min-height:0}.app-root>*:not(.topbar):not(.sheet-tabs-bar):not(.filterbar):not(.statusbar){min-height:0;overflow:hidden}.topbar{display:flex;align-items:center;padding:8px 16px;gap:24px;border-bottom:1px solid var(--gsheet-grid);background:#f8f9fa}.brand{font-weight:600;color:var(--gsheet-green-dark);font-size:18px}.menubar{display:flex;gap:2px;color:var(--gsheet-text-muted);font-size:13px}.menu-item{position:relative}.menu-trigger{background:transparent;border:none;padding:4px 10px;border-radius:4px;cursor:pointer;color:var(--gsheet-text-muted);font-size:13px}.menu-trigger:hover,.menu-item.open .menu-trigger{background:#eef1f4;color:var(--gsheet-text)}.menu-dropdown{position:absolute;top:100%;left:0;margin:4px 0 0;padding:6px 0;list-style:none;background:#fff;border:1px solid var(--gsheet-grid);border-radius:6px;box-shadow:0 4px 16px #00000026;min-width:220px;z-index:100}.menu-action{width:100%;text-align:left;background:transparent;border:none;padding:6px 16px;cursor:pointer;font-size:13px;color:var(--gsheet-text)}.menu-action:hover:not(:disabled){background:var(--gsheet-highlight)}.menu-action:disabled{color:var(--gsheet-text-muted);cursor:default;font-style:italic}.menu-separator{height:1px;background:var(--gsheet-grid);margin:4px 0}.sheet-tabs-bar{display:flex;align-items:center;gap:0;padding:0 6px;background:#fff;border-top:1px solid var(--gsheet-grid);height:36px;position:relative;font-size:12px}.sheet-tabs-icon{background:transparent;border:none;color:var(--gsheet-text-muted);font-size:18px;width:32px;height:32px;border-radius:3px;cursor:pointer;display:flex;align-items:center;justify-content:center}.sheet-tabs-icon:hover{background:#f1f3f4}.sheet-tabs-list{display:flex;overflow-x:auto;overflow-y:hidden;flex:1;margin-left:4px;scrollbar-width:none}.sheet-tabs-list::-webkit-scrollbar{display:none}.sheet-tab{display:flex;align-items:center;height:32px;padding:0 4px 0 12px;border-radius:4px 4px 0 0;color:var(--gsheet-text-muted);cursor:pointer;position:relative;border-right:1px solid transparent;flex-shrink:0}.sheet-tab:hover{background:#f1f3f4}.sheet-tab.active{background:#e8f0fe;color:#1a73e8;font-weight:500;border-top:2px solid #1a73e8;border-radius:3px 3px 0 0}.sheet-tab-label{background:transparent;border:none;color:inherit;font-weight:inherit;cursor:pointer;padding:0 4px;height:100%;font-size:12px;white-space:nowrap}.sheet-tab-input{border:1px solid var(--gsheet-green);outline:none;background:#fff;padding:2px 6px;border-radius:3px;font-size:12px;height:22px;min-width:120px;color:var(--gsheet-text)}.sheet-tab-caret{background:transparent;border:none;color:inherit;font-size:8px;cursor:pointer;padding:0 6px;height:100%;opacity:.6}.sheet-tab:hover .sheet-tab-caret,.sheet-tab.active .sheet-tab-caret{opacity:1}.sheet-tab-dropdown{position:absolute;bottom:100%;left:0;margin-bottom:2px;background:#fff;border:1px solid var(--gsheet-grid);border-radius:6px;box-shadow:0 4px 16px #00000026;min-width:180px;z-index:100;padding:6px 0;display:flex;flex-direction:column}.sheet-tab-dropdown button{background:transparent;border:none;text-align:left;padding:8px 16px;cursor:pointer;font-size:13px;color:var(--gsheet-text)}.sheet-tab-dropdown button:hover:not(:disabled){background:var(--gsheet-highlight)}.sheet-tab-dropdown button:disabled{color:var(--gsheet-text-muted);cursor:default;font-style:italic}.sheet-tabs-list-menu{position:absolute;bottom:100%;left:40px;margin-bottom:4px;background:#fff;border:1px solid var(--gsheet-grid);border-radius:6px;box-shadow:0 4px 16px #00000026;min-width:220px;z-index:100;padding:6px 0;display:flex;flex-direction:column}.sheet-tabs-list-item{background:transparent;border:none;text-align:left;padding:8px 16px;cursor:pointer;font-size:13px;color:var(--gsheet-text)}.sheet-tabs-list-item:hover{background:var(--gsheet-highlight)}.sheet-tabs-list-item.active{color:#1a73e8;font-weight:500}.sheet-tabs-scroll-hint{color:var(--gsheet-text-muted);padding:0 8px;font-size:12px;cursor:default;-webkit-user-select:none;user-select:none}.header-actions{margin-left:auto;display:flex;gap:8px;align-items:center}.analytics-panel{padding:16px;display:grid;grid-template-columns:repeat(auto-fit,minmax(320px,1fr));gap:16px;overflow-y:auto;background:#f8f9fa;flex:1}.analytics-card{background:#fff;border:1px solid var(--gsheet-grid);border-radius:6px;padding:16px}.analytics-card h3{margin:0 0 12px;color:var(--gsheet-green-dark);font-size:14px;border-bottom:1px solid var(--gsheet-grid);padding-bottom:8px}.ranking-list{padding-left:20px;margin:0;font-size:13px}.ranking-list li{padding:4px 0;display:flex;justify-content:space-between;gap:12px}.rank-title{color:var(--gsheet-text)}.rank-point{color:var(--gsheet-green-dark);font-weight:600;font-size:12px}.keyword-cloud{display:flex;flex-wrap:wrap;gap:8px}.keyword-chip{background:var(--gsheet-highlight);color:var(--gsheet-green-dark);padding:3px 10px;border-radius:12px;line-height:1.4}.keyword-chip sup{color:var(--gsheet-text-muted);margin-left:3px;font-size:10px}.analytics-table{width:100%;border-collapse:collapse;font-size:12px}.analytics-table th,.analytics-table td{border-bottom:1px solid var(--gsheet-grid);padding:6px 8px;text-align:right}.analytics-table th:first-child,.analytics-table td:first-child{text-align:left}.analytics-table th{background:#f1f3f4;color:var(--gsheet-text-muted);font-weight:500}.trend-chart{display:flex;align-items:flex-end;gap:4px;height:140px;padding:4px;border-bottom:1px solid var(--gsheet-grid)}.trend-bar-wrap{flex:1;display:flex;flex-direction:column;align-items:center;height:100%;justify-content:flex-end}.trend-bar{width:100%;background:linear-gradient(180deg,var(--gsheet-green),#34a853);border-radius:2px 2px 0 0;min-height:2px}.trend-label{font-size:9px;color:var(--gsheet-text-muted);margin-top:4px;transform:rotate(-45deg);transform-origin:center;white-space:nowrap}.plans-output{background:#f8f9fa;border:1px solid var(--gsheet-grid);padding:12px;border-radius:4px;white-space:pre-wrap;font-family:inherit;font-size:13px;line-height:1.6;margin-top:12px}.analytics-error{grid-column:1 / -1;background:#fce8e6;color:#c5221f;padding:8px;border-radius:3px}.upload-btn{background:var(--gsheet-green);color:#fff;padding:6px 14px;border-radius:4px;cursor:pointer;font-weight:500;font-size:13px}.secondary-btn{background:#fff;color:var(--gsheet-text);border:1px solid var(--gsheet-grid);padding:6px 12px;border-radius:4px;cursor:pointer;font-size:13px}.secondary-btn:hover{background:#f1f3f4}.logout-btn{background:transparent;border:1px solid var(--gsheet-grid);padding:4px 12px;border-radius:4px;cursor:pointer;color:var(--gsheet-text-muted);font-size:12px}.login-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;background:#f1f3f4}.login-card{background:#fff;padding:32px 40px;border-radius:8px;box-shadow:0 1px 3px #0000001f;width:320px;display:flex;flex-direction:column;gap:16px}.login-card h1{margin:0 0 8px;font-size:20px;color:var(--gsheet-green-dark)}.login-card label{display:flex;flex-direction:column;gap:4px;font-size:12px;color:var(--gsheet-text-muted)}.login-card input{padding:8px;border:1px solid var(--gsheet-grid);border-radius:3px}.login-card button{background:var(--gsheet-green);color:#fff;border:none;padding:10px;border-radius:4px;cursor:pointer;font-weight:500}.login-card button:disabled{opacity:.6}.login-error{background:#fce8e6;color:#c5221f;padding:8px;border-radius:3px;font-size:12px}.password-input-wrap{position:relative;display:flex}.password-input-wrap input{flex:1;padding-right:56px}.password-toggle{position:absolute;right:6px;top:50%;transform:translateY(-50%);background:transparent!important;border:none!important;padding:4px 8px!important;font-size:12px!important;font-weight:500!important;cursor:pointer;line-height:1;color:var(--gsheet-green-dark)!important;border-radius:3px}.password-toggle:hover{background:var(--gsheet-highlight)!important}.link-btn{background:transparent!important;border:none!important;color:var(--gsheet-green-dark)!important;cursor:pointer;text-decoration:underline;padding:4px!important;font-size:12px!important;font-weight:400!important}.forgot-note,.recovered-note{font-size:12px;color:var(--gsheet-text-muted);line-height:1.6;margin:0}.recovered-creds{background:#f8f9fa;border:1px solid var(--gsheet-grid);border-radius:4px;padding:12px;display:flex;flex-direction:column;gap:8px}.recovered-creds>div{display:flex;flex-direction:column;gap:2px}.recovered-creds span{font-size:11px;color:var(--gsheet-text-muted)}.recovered-creds code{background:#fff;border:1px solid var(--gsheet-grid);padding:6px 10px;border-radius:3px;font-family:SF Mono,Menlo,monospace;font-size:13px;color:var(--gsheet-text);-webkit-user-select:all;user-select:all}.secondary-cta{background:transparent!important;color:var(--gsheet-green-dark)!important;border:1px solid var(--gsheet-green)!important}.warn-note{color:#c5221f;font-size:11px;display:inline-block;margin-top:6px}.filterbar{display:flex;gap:12px;flex-wrap:wrap;padding:8px 16px;border-bottom:1px solid var(--gsheet-grid);background:#fff;align-items:center;font-size:12px}.filterbar label{display:flex;align-items:center;gap:4px;color:var(--gsheet-text-muted)}.filterbar input{border:1px solid var(--gsheet-grid);padding:4px 6px;border-radius:3px;font-size:12px}.filterbar input[type=number]{width:80px}.filterbar button{background:transparent;border:1px solid var(--gsheet-grid);padding:4px 10px;border-radius:3px;cursor:pointer}.statusbar{padding:4px 16px;border-bottom:1px solid var(--gsheet-grid);color:var(--gsheet-text-muted);background:#f8f9fa;font-size:12px}.high-price{background-color:#fef7e0!important;font-weight:600}.top-sales{background-color:#e6f4ea!important;color:var(--gsheet-green-dark);font-weight:600}.filter-toggle-row{display:flex;padding:4px 12px;background:#f8f9fa;border-bottom:1px solid var(--gsheet-grid);flex-shrink:0}.filter-toggle-btn{background:transparent;border:1px solid transparent;border-radius:3px;padding:3px 10px;font-size:12px;color:var(--gsheet-text-muted);cursor:pointer;font-family:inherit}.filter-toggle-btn:hover{background:var(--gsheet-highlight);color:var(--gsheet-green-dark)}.fmt-toolbar{display:flex;align-items:center;gap:4px;padding:4px 12px;background:#f8f9fa;border-bottom:1px solid var(--gsheet-grid);flex-shrink:0;font-size:12px;color:var(--gsheet-text);min-height:34px;flex-wrap:wrap}.fmt-select{height:26px;padding:0 6px;border:1px solid transparent;border-radius:3px;background:transparent;font-size:12px;color:var(--gsheet-text);cursor:pointer;min-width:90px}.fmt-select-narrow{min-width:60px}.fmt-size-stepper{display:inline-flex;align-items:center;gap:0;height:26px}.fmt-size-btn{width:22px;height:22px;padding:0;border:1px solid transparent;border-radius:3px;background:transparent;color:var(--gsheet-text);cursor:pointer;font-size:14px;display:inline-flex;align-items:center;justify-content:center;line-height:1}.fmt-size-btn:hover:not(:disabled){background:var(--gsheet-highlight)}.fmt-size-btn:disabled{color:#bdc1c6;cursor:not-allowed}.fmt-size-input{width:34px;height:22px;padding:0 4px;margin:0 2px;text-align:center;border:1px solid var(--gsheet-grid);border-radius:3px;font-size:12px;background:#fff;color:var(--gsheet-text)}.fmt-size-input:disabled{background:transparent;color:#bdc1c6;border-color:transparent}.fmt-size-input:focus{outline:none;border-color:var(--gsheet-green);box-shadow:0 0 0 1px var(--gsheet-green)}.fmt-select:hover:not(:disabled){background:var(--gsheet-highlight)}.fmt-select:disabled{color:#bdc1c6;cursor:not-allowed}.fmt-btn{height:26px;min-width:26px;padding:0 6px;border:1px solid transparent;border-radius:3px;background:transparent;font-size:13px;color:var(--gsheet-text);cursor:pointer;display:inline-flex;align-items:center;justify-content:center;position:relative}.fmt-btn:hover:not(:disabled){background:var(--gsheet-highlight)}.fmt-btn:disabled{color:#bdc1c6;cursor:not-allowed}.fmt-btn-clear{padding:0 10px;font-size:12px}.fmt-undo,.fmt-redo{font-size:16px;min-width:26px;line-height:1}.fmt-sep{width:1px;height:20px;background:var(--gsheet-grid);margin:0 4px}.fmt-underline{display:block;position:absolute;bottom:4px;left:8px;right:8px;height:3px;border-radius:1px}.fmt-fill-icon{display:inline-block;width:12px;height:12px;background:linear-gradient(135deg,#fff 50%,#fbbc04 50%);border:1px solid var(--gsheet-grid);border-radius:2px}.fmt-popover-wrap{position:relative;display:inline-block}.fmt-popover{position:absolute;top:100%;left:0;z-index:50;background:#fff;border:1px solid var(--gsheet-grid);box-shadow:0 4px 12px #00000026;border-radius:6px;padding:8px;min-width:180px;margin-top:4px}.fmt-swatch-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:4px;margin-bottom:8px}.fmt-swatch{width:28px;height:28px;border:1px solid var(--gsheet-grid);border-radius:3px;cursor:pointer;padding:0}.fmt-swatch:hover{outline:2px solid var(--gsheet-green)}.fmt-swatch-none{background:repeating-linear-gradient(45deg,#fff,#fff 4px,#d93025 4px,#d93025 5px)}.fmt-picker-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0;font-size:12px}.fmt-picker-row input[type=color]{width:32px;height:24px;border:1px solid var(--gsheet-grid);padding:0;cursor:pointer}.fmt-picker-clear{width:100%;padding:6px;border:1px solid var(--gsheet-grid);background:#fff;border-radius:3px;cursor:pointer;font-size:12px;margin-top:4px}.fmt-picker-clear:hover{background:var(--gsheet-highlight)}.fmt-menu-item{display:block;width:100%;text-align:left;padding:6px 10px;border:none;background:transparent;cursor:pointer;font-size:12px;color:var(--gsheet-text);border-radius:3px}.fmt-menu-item:hover{background:var(--gsheet-highlight)}.fmt-popover-borders,.fmt-popover-align{min-width:140px;padding:4px}.fmt-status{margin-left:auto;font-size:11px;color:var(--gsheet-text-muted)}.grid-wrap{display:flex;flex-direction:column;flex:1;min-height:0}.grid-inner{width:100%;flex:1;min-height:0}.aggregation-bar{display:flex;gap:20px;padding:6px 16px;background:#f1f3f4;border-top:1px solid var(--gsheet-grid);font-size:12px;color:var(--gsheet-text-muted);align-items:center}.aggregation-bar strong{color:var(--gsheet-text);font-weight:600;margin-left:4px}.aggregation-bar>span:first-child{font-weight:500;color:var(--gsheet-green-dark)}.ag-header-cell.spreadsheet-header-cell{background-color:#e8eaed!important;color:#000!important;font-weight:700;font-size:12px}.ag-header-cell.spreadsheet-header-cell .ag-header-cell-text{font-weight:700;color:#000}.ag-header-cell.spreadsheet-header-cell .ag-icon-asc,.ag-header-cell.spreadsheet-header-cell .ag-icon-desc{color:var(--gsheet-green-dark)!important;font-weight:700!important}.ag-header-cell.spreadsheet-header-cell .ag-icon-asc:before{content:"▲"!important;font-family:inherit!important;font-size:15px;line-height:1}.ag-header-cell.spreadsheet-header-cell .ag-icon-desc:before{content:"▼"!important;font-family:inherit!important;font-size:15px;line-height:1}.ag-header-cell.spreadsheet-header-cell .ag-sort-indicator-container{margin-left:6px}.ag-header-cell.spreadsheet-header-cell .ag-sort-order{color:var(--gsheet-green-dark)!important;font-weight:700!important;font-size:11px!important;margin-left:2px}.ag-header-cell.spreadsheet-header-cell .ag-header-cell-label{justify-content:center}.ag-header-cell.spreadsheet-header-cell .ag-header-cell-text{text-align:center}.ag-header-group-cell.letter-group-header{background:#e8eaed!important;padding:0!important;border-bottom:1px solid var(--gsheet-grid)}.ag-header-group-cell.letter-group-header .ag-header-group-cell-label{padding:0!important;width:100%;height:100%}.letter-band-row{width:100%;height:100%;background:transparent;border:none;color:#000;font-size:12px;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;font-family:inherit;padding:0}.letter-band-row:hover{background:var(--gsheet-highlight);color:var(--gsheet-green-dark)}.spreadsheet-corner-header{background-color:#e8eaed!important;padding:0!important;border-right:1px solid var(--gsheet-grid)!important}.corner-select-all{display:flex;align-items:center;justify-content:center;width:100%;height:100%;cursor:pointer}.corner-select-all input[type=checkbox]{width:14px;height:14px;cursor:pointer;accent-color:var(--gsheet-green)}.ag-cell.clickable-detail-cell{cursor:zoom-in}.detail-modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;background:#20212480;display:flex;align-items:center;justify-content:center;z-index:1000}.detail-modal{background:#fff;border-radius:8px;box-shadow:0 10px 40px #0000004d;width:min(760px,90vw);max-height:80vh;display:flex;flex-direction:column;overflow:hidden}.detail-modal-header{display:flex;align-items:center;justify-content:space-between;padding:12px 16px;background:var(--gsheet-green-dark);color:#fff}.detail-modal-title{font-weight:600;font-size:14px}.detail-modal-close{background:transparent;color:#fff;border:none;font-size:22px;cursor:pointer;line-height:1;padding:0 4px}.detail-modal-body{padding:16px;overflow-y:auto;flex:1;min-height:0}.detail-modal-content{margin:0;white-space:pre-wrap;word-break:break-word;font-family:-apple-system,Segoe UI,Roboto,Hiragino Sans,Noto Sans JP,sans-serif;font-size:13px;line-height:1.7;color:var(--gsheet-text)}.detail-modal-footer{display:flex;align-items:center;justify-content:space-between;padding:10px 16px;border-top:1px solid var(--gsheet-grid);background:#f8f9fa}.detail-modal-hint{color:var(--gsheet-text-muted);font-size:12px}.detail-modal-copy{background:var(--gsheet-green);color:#fff;border:none;padding:6px 14px;border-radius:4px;cursor:pointer;font-size:12px;font-weight:500}.detail-modal-copy:hover{background:var(--gsheet-green-dark)}.ag-cell.tx-matched{background-color:#e6f4ea!important;color:var(--gsheet-green-dark);font-weight:500}.ag-cell.tx-unmatched{background-color:#fce8e6!important;color:#c5221f;font-style:italic}.ag-cell.range-selected{background-color:#0f9d5826!important;outline:1px solid rgba(15,157,88,.4);outline-offset:-1px}.ag-cell.range-selected.high-price,.ag-cell.range-selected.top-sales{background-color:#0f9d5847!important}
